Build one shared image for web and celery

This commit is contained in:
sajeyks 2026-10-09 19:15:41 +03:00
commit aecedc6c90
2 changed files with 13 additions and 0 deletions

View file

@ -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).

View file

@ -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