From c5f740518e52bb181be61fdb8962f95660b08f85 Mon Sep 17 00:00:00 2001 From: neymar <0208mjkim@gmail.com> Date: Mon, 25 Nov 2024 22:05:01 +0900 Subject: [PATCH 1/2] refactor: docker-compose.yml --- docker-compose.yml | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 32f0e0ce..b657ece6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,13 @@ version: "3.9" -name: "biseo" +name: "biseo-test" services: web: container_name: biseo-web + image: ghcr.io/sparcs-kaist/biseo-web:latest + labels: + - "com.centurylinklabs.watchtower.enable=true" restart: always - build: - context: . - dockerfile: .docker/web.Dockerfile ports: - "${EXPOSE_PORT:?}:80" environment: @@ -16,45 +16,55 @@ services: - api networks: - frontend + api: container_name: biseo-api + image: ghcr.io/sparcs-kaist/biseo-api:latest + labels: + - "com.centurylinklabs.watchtower.enable=true" restart: always environment: - NODE_ENV=production - SERVER_PORT=8000 - - DATABASE_URL=mysql://root:${DB_PASSWORD:?}@db:3306/${DB_NAME:?} - - SECRET_KEY=${SECRET_KEY:?} - build: - context: . - dockerfile: .docker/api.Dockerfile + - DATABASE_URL=mysql://root:${DB_PASSWORD}@db:3306/${DB_NAME} + - SECRET_KEY=${SECRET_KEY} depends_on: - db: - condition: service_healthy + - db networks: - frontend - backend + db: - container_name: biseo-db - restart: always image: mysql:8.0 + restart: always environment: - - MYSQL_ROOT_PASSWORD=${DB_PASSWORD:?} - - MYSQL_DATABASE=${DB_NAME:?} + - MYSQL_ROOT_PASSWORD=${DB_PASSWORD} + - MYSQL_DATABASE=${DB_NAME} volumes: - biseo-data:/var/lib/mysql - command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + command: + - --character-set-server=utf8mb4 + - --collation-server=utf8mb4_unicode_ci networks: - backend healthcheck: test: "mysql -uroot -p$$MYSQL_ROOT_PASSWORD $$MYSQL_DATABASE -e 'select 1'" - start_period: 0s interval: 1s retries: 3 + watchtower: + image: containrrr/watchtower + volumes: + - /var/run/docker.sock:/var/run/docker.sock + command: --interval 30 + environment: + - WATCHTOWER_CLEANUP=true + - WATCHTOWER_LABEL_ENABLE=true + volumes: biseo-data: external: true networks: frontend: - backend: + backend: \ No newline at end of file From 5eaa1384474a0f4c1ff64f43b17b66ff0f6861be Mon Sep 17 00:00:00 2001 From: neymar <0208mjkim@gmail.com> Date: Mon, 25 Nov 2024 22:37:41 +0900 Subject: [PATCH 2/2] fix: prettier --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index b657ece6..adee67c8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -67,4 +67,4 @@ volumes: networks: frontend: - backend: \ No newline at end of file + backend: