From d33c50a087f1d125c5d4e47e6d302fce298a498a Mon Sep 17 00:00:00 2001 From: casablanca Date: Thu, 8 Oct 2026 01:32:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D1=87=D0=B5=D1=81=D0=BA=D0=B8=D0=B5=20=D0=BC=D0=B8=D0=B3=D1=80?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose.yaml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/compose.yaml b/compose.yaml index 9a4a3c33..8bed7491 100644 --- a/compose.yaml +++ b/compose.yaml @@ -27,12 +27,26 @@ services: volumes: - redis_data:/data healthcheck: - test: [ "CMD", "redis-cli", "ping" ] + test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 10 start_period: 5s + migrate: + build: + context: . + dockerfile: Dockerfile + command: ["alembic", "upgrade", "head"] + environment: + DATABASE_URL_FILE: ${DATABASE_URL_FILE:-/run/secrets/database_url} + secrets: + - database_url + depends_on: + postgres: + condition: service_healthy + restart: "no" + api: build: context: . @@ -49,8 +63,8 @@ services: - database_url - cache_url depends_on: - postgres: - condition: service_healthy + migrate: + condition: service_completed_successfully redis: condition: service_healthy ports: