diff --git a/DOCKER.md b/DOCKER.md index 56651edf..e00561ac 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -64,6 +64,18 @@ Checklist: - The web container runs Django's `runserver`; put a real web server or proxy in front for real traffic. +## Image and Kubernetes + +One image, `dynamicweb:latest`, serves both roles; only the command differs: + +- web: `sh start-web.sh` (port 8000) +- celery: `celery -A dynamicweb worker -l info` + +The image's entrypoint (`/entrypoint.sh`) writes the DB settings from the environment and waits +for Postgres before running the command, so in Kubernetes set `args:`, not `command:` +(`command:` replaces the entrypoint). Configuration is the environment variables in +`.env.docker`: use a ConfigMap and a Secret, and set `DJANGO_SECRET_KEY` there. + ## Configuration - `.env.docker`: committed dev defaults. `.env`: your overrides (git-ignored). diff --git a/docker-compose.yml b/docker-compose.yml index dd0e3990..ab03b07f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,6 @@ x-app: &app build: . + image: dynamicweb:latest # one image; web and celery differ only by command env_file: - .env.docker - path: .env # optional local overrides