fix(deploy): apply alembic migrations before uvicorn in the server overlay
This commit is contained in:
@@ -16,7 +16,13 @@
|
|||||||
# dispatch bus (alias legacyhub-api) — teamhub_net is a regular bridge, so
|
# dispatch bus (alias legacyhub-api) — teamhub_net is a regular bridge, so
|
||||||
# it also provides the egress needed for first-run HuggingFace downloads;
|
# it also provides the egress needed for first-run HuggingFace downloads;
|
||||||
# - identity enforcement is env-driven: AUTH_REQUIRE_IDENTITY (set true on
|
# - 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
|
# The shared network must exist first: docker network create teamhub_net
|
||||||
|
|
||||||
@@ -52,6 +58,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
api:
|
api:
|
||||||
|
command: ["sh", "-c", "alembic upgrade head && exec uvicorn app.main:app --host 0.0.0.0 --port 8000"]
|
||||||
ports: !override
|
ports: !override
|
||||||
- "${LEGACYHUB_API_BIND:-127.0.0.1}:${API_HOST_PORT:-8050}:8000"
|
- "${LEGACYHUB_API_BIND:-127.0.0.1}:${API_HOST_PORT:-8050}:8000"
|
||||||
networks: !override
|
networks: !override
|
||||||
|
|||||||
Reference in New Issue
Block a user