refactor(docker): consolidate static file init service and update ports
All checks were successful
CVE Scan & Docker Build / security-scan (push) Successful in 50s
CVE Scan & Docker Build / build-and-push (push) Successful in 1m1s

Remove dedicated static-init service and run collectstatic in the init sidecar instead.
Static files baked into the image are copied to /mnt/static for nginx serving on each
deployment. Also update MCP and nginx ports and refresh external service hostnames
in comments.
This commit is contained in:
2026-05-14 06:31:34 -04:00
parent ef733cb7bf
commit ba3ab3d855
2 changed files with 74 additions and 54 deletions

View File

@@ -63,6 +63,11 @@ case "$1" in
# or library_type defaults need to change. A non-zero exit here blocks
# `app`, `mcp`, and `worker` from starting.
#
# collectstatic copies the static files baked into the image at build
# time (/app/staticfiles) into STATIC_ROOT (/mnt/static), which nginx
# serves directly. --clear removes any stale files from the previous
# deploy before copying, so deleted assets don't linger.
#
# Neo4j vector-index creation is *deliberately not* bundled here. That
# command (``setup_neo4j_indexes``) requires a system embedding model
# with a configured ``vector_dimensions`` value, and that model is
@@ -71,7 +76,7 @@ case "$1" in
# whole stack on it would make the admin unreachable — a chicken-and-
# egg. Operator bootstrap flow:
#
# 1. docker compose up # init sidecar: migrate + load_library_types
# 1. docker compose up # init sidecar: migrate + collectstatic + load_library_types
# 2. browse to admin, configure system embedding model
# 3. docker compose exec app python manage.py setup_neo4j_indexes
#
@@ -80,6 +85,7 @@ case "$1" in
# missing so this is visible, not silent.
set -e
python manage.py migrate --noinput
python manage.py collectstatic --noinput --clear
python manage.py load_library_types
;;