From dabb4db2e376cdd64e887dee3acd3e79d3ebec3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Fri, 18 Sep 2026 11:27:36 -0300 Subject: [PATCH] fix: make DTF compose stack Swarm compatible --- docker-compose.yml | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1e3d2b2..be614ae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,5 @@ -name: ${COMPOSE_PROJECT_NAME:-dtf-cloud} x-app: &app - build: - context: . - dockerfile: local/Dockerfile + image: ${API_IMAGE:-gitea.blyzer.com.br/blyzer/dtf-api}:${IMAGE_TAG:-latest} environment: &environment APP_ENV: ${APP_ENV:-local} DATABASE_URL: postgresql://${APP_DB_USER:-dtf_app}:${APP_DB_PASSWORD:-local-app-database-only}@db:5432/${POSTGRES_DB:-dtf_local} @@ -58,17 +55,14 @@ services: memory: 3G pids: 128 db-init: - build: - context: . - dockerfile: local/Dockerfile + image: ${API_IMAGE:-gitea.blyzer.com.br/blyzer/dtf-api}:${IMAGE_TAG:-latest} command: python -m local.bootstrap environment: DATABASE_ADMIN_URL: postgresql://${POSTGRES_USER:-dtf_local}:${POSTGRES_PASSWORD:-local-database-only}@db:5432/${POSTGRES_DB:-dtf_local} APP_DB_USER: ${APP_DB_USER:-dtf_app} APP_DB_PASSWORD: ${APP_DB_PASSWORD:-local-app-database-only} networks: [local] - depends_on: - db: {condition: service_healthy} + depends_on: [db] storage-init: image: minio/minio:RELEASE.2025-04-22T22-12-26Z entrypoint: [/bin/sh, /init.sh] @@ -83,8 +77,7 @@ services: - ./local/storage-policy.json:/policy.json:ro - ./local/storage-lifecycle.json:/lifecycle.json:ro networks: [local] - depends_on: - storage: {condition: service_healthy} + depends_on: [storage] db: image: postgres:17-alpine environment: @@ -115,9 +108,7 @@ services: api: <<: *app command: uvicorn local.app:app --host 0.0.0.0 --port 8000 --no-access-log - depends_on: - db-init: {condition: service_completed_successfully} - storage-init: {condition: service_completed_successfully} + depends_on: [db-init, storage-init] healthcheck: test: [CMD, python, -c, "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"] interval: 5s @@ -126,40 +117,32 @@ services: worker: <<: *app command: python -m local.worker - depends_on: - api: {condition: service_healthy} - scanner: {condition: service_healthy} + depends_on: [api, scanner] healthcheck: test: [CMD, python, -c, "import urllib.request; urllib.request.urlopen('http://localhost:8002/health')"] interval: 5s timeout: 3s retries: 12 site: - build: - context: . - dockerfile: local/Dockerfile.web + image: ${WEB_IMAGE:-gitea.blyzer.com.br/blyzer/dtf-web}:${IMAGE_TAG:-latest} environment: S3_PUBLIC_ENDPOINT: ${S3_PUBLIC_ENDPOINT:-http://localhost:9000} ports: ["127.0.0.1:${SITE_PORT:-8080}:80", "127.0.0.1:${API_PORT:-8000}:81"] networks: [local, edge] - depends_on: - api: {condition: service_healthy} + depends_on: [api] healthcheck: test: [CMD, wget, -q, -O, /dev/null, http://127.0.0.1/health] interval: 5s timeout: 3s retries: 12 kanban: - build: - context: . - dockerfile: local/Dockerfile.web + image: ${WEB_IMAGE:-gitea.blyzer.com.br/blyzer/dtf-web}:${IMAGE_TAG:-latest} environment: WEB_INDEX: kanban.html S3_PUBLIC_ENDPOINT: ${S3_PUBLIC_ENDPOINT:-http://localhost:9000} ports: ["127.0.0.1:${KANBAN_PORT:-8081}:80"] networks: [local, edge] - depends_on: - api: {condition: service_healthy} + depends_on: [api] healthcheck: test: [CMD, wget, -q, -O, /dev/null, http://127.0.0.1/health] interval: 5s