fix(deploy): apply alembic migrations before uvicorn in the server overlay
Some checks failed
CI / Backend (lint + tests + compose) (push) Has been cancelled
CI / Frontend (lint + type-check + build) (push) Has been cancelled

This commit is contained in:
Vadim Malanov
2026-07-11 18:13:21 +03:00
parent 01126a4cab
commit 4eb6822736

View File

@@ -16,7 +16,13 @@
# dispatch bus (alias legacyhub-api) — teamhub_net is a regular bridge, so
# it also provides the egress needed for first-run HuggingFace downloads;
# - identity enforcement is env-driven: AUTH_REQUIRE_IDENTITY (set true on
# the server; machine paths keep X-API-Key auth).
# the server; machine paths keep X-API-Key auth);
# - applies alembic migrations before uvicorn starts. The base compose api
# command is a bare `uvicorn` (no migrate step, unlike ToolsHUB/SalesHUB),
# so a fresh server DB stayed empty and every DB-backed request 500'd on
# `relation does not exist` while /health (liveness) still returned 200.
# The worker (restart: always) tolerates the brief startup race until the
# schema exists.
#
# The shared network must exist first: docker network create teamhub_net
@@ -52,6 +58,7 @@ services:
restart: always
api:
command: ["sh", "-c", "alembic upgrade head && exec uvicorn app.main:app --host 0.0.0.0 --port 8000"]
ports: !override
- "${LEGACYHUB_API_BIND:-127.0.0.1}:${API_HOST_PORT:-8050}:8000"
networks: !override