Добавить X-Instance-Id, задержку drain при SIGTERM и отдельный запуск миграций

This commit is contained in:
2026-11-02 16:58:11 +03:00
parent 5b9f377783
commit 7fa8881eb3
21 changed files with 389 additions and 64 deletions
+17
View File
@@ -19,6 +19,8 @@ services:
- database_url
- session_store_url
depends_on:
migrate:
condition: service_completed_successfully
postgres:
condition: service_healthy
valkey:
@@ -28,6 +30,21 @@ services:
- "${PUBLISH:-127.0.0.1:8080}:8080"
stop_grace_period: 10s
# One-shot: applies the schema before the API starts, then exits.
migrate:
image: mtusi-messenger:lab3
entrypoint: ["/usr/local/bin/migrate"]
environment:
DATABASE_URL_FILE: /run/secrets/database_url
secrets:
- database_url
depends_on:
postgres:
condition: service_healthy
restart: "no"
healthcheck:
disable: true
postgres:
image: postgres:18.6-alpine3.24@sha256:77f585114c32fbca283dc835b0596f4e52b51b4c6662d7810b2f4084f60a1873
environment: