Skip to content

Commit

Permalink
[chore] docker image 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunihs committed Sep 28, 2023
1 parent d58def2 commit c6bb379
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ jobs:
sudo docker stop $(sudo docker ps -a -q)
sudo docker rm $(sudo docker ps -a -q)
sudo docker rmi $(sudo docker images -q)
sudo docker-compose -f ~/srv/ubuntu/docker-compose.yml pull
sudo docker-compose -f ~/srv/ubuntu/docker-compose.yml up --build -d
sudo docker-compose -f ~/srv/ubuntu/docker-compose.dev.yml pull
sudo docker-compose -f ~/srv/ubuntu/docker-compose.dev.yml up --build -d
2 changes: 1 addition & 1 deletion .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/ceos-backend-dev
tags: ${{ secrets.DOCKER_USERNAME }}/ceos-backend

- name: create remote directory
uses: appleboy/ssh-action@master
Expand Down
2 changes: 1 addition & 1 deletion config/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ server {

location / {
proxy_set_header Host $host;
proxy_pass http://backend-dev:8080/;
proxy_pass http://backend:8080/;
proxy_read_timeout 90;

## try_files $uri $uri/ =404;
Expand Down
26 changes: 26 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: "3"

services:
backend:
image: ceos17/ceos-backend-dev
container_name: backend
hostname: backend
expose:
- "8080"

nginx:
depends_on:
- backend
restart: always
build:
dockerfile: Dockerfile
context: ./config/nginx
ports:
- "80:80"

redis:
image: redis:latest
container_name: redis
hostname: redis
ports:
- "6379:6379"
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
version: "3"

services:
backend-dev:
image: ceos17/ceos-backend-dev
container_name: backend-dev
hostname: backend-dev
backend:
image: ceos17/ceos-backend
container_name: backend
hostname: backend
expose:
- "8080"

nginx:
depends_on:
- backend-dev
- backend
restart: always
build:
dockerfile: Dockerfile
Expand Down

0 comments on commit c6bb379

Please sign in to comment.