forked from mtusi2026/mtusi2026lab3
Исправить балансировку и миграции лабы 3
This commit is contained in:
+17
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user