forked from mtusi2026/mtusi2026lab3
feat-(migrations race in api's replicas stopped)new service migrate created
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
services:
|
||||
migrate:
|
||||
build: .
|
||||
command: python -m scripts.run_migrations
|
||||
environment:
|
||||
- DATABASE_URL=postgresql+asyncpg://mtusi:1878@postgres:5432/mtusi-messenger
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
nginx:
|
||||
image: nginx:1.25-alpine
|
||||
ports:
|
||||
@@ -24,6 +32,8 @@ services:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health/ready', timeout=2)"] #засекретить?
|
||||
@@ -33,6 +43,10 @@ services:
|
||||
retries: 3
|
||||
deploy:
|
||||
replicas: 2
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.5'
|
||||
memory: 512M
|
||||
|
||||
postgres:
|
||||
image: postgres:16.3-alpine
|
||||
|
||||
Reference in New Issue
Block a user