Исправить балансировку и миграции лабы 3

This commit is contained in:
2026-11-18 17:44:53 +03:00
parent 2f1cf3afac
commit e51dc20fce
6 changed files with 106 additions and 6 deletions
+17 -1
View File
@@ -6,7 +6,9 @@ services:
ports:
- "8080:8080"
volumes:
- ./infra/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./infra/nginx/nginx.conf:/etc/nginx/nginx.conf.template:ro
- ./infra/nginx/run.sh:/usr/local/bin/run-nginx.sh:ro
command: ["/bin/sh", "/usr/local/bin/run-nginx.sh"]
depends_on:
api1:
condition: service_healthy
@@ -33,6 +35,8 @@ services:
- database_url
- cache_url
depends_on:
migrate:
condition: service_completed_successfully
postgres:
condition: service_healthy
redis:
@@ -55,6 +59,18 @@ services:
<<: *api-env
INSTANCE_ID: api2
migrate:
build: .
image: mtusi2026lab3-api:local
command: ["python", "-m", "app.migrate"]
environment:
DATABASE_URL_FILE: /run/secrets/database_url
secrets:
- database_url
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:16.4
environment: