1
0

Added entrypoint, changed Dockerfile to multi-target variant

This commit is contained in:
2026-03-30 16:30:51 +00:00
parent 8837ebe470
commit c1ef3a75b9
3 changed files with 78 additions and 5 deletions

View File

@@ -56,3 +56,29 @@ uv run celery -A comment_automation.celery_app:celery_app worker --loglevel=info
Without uv (venv already created):
./.venv/bin/celery -A comment_automation.celery_app:celery_app worker --loglevel=info
## Docker targets and entrypoint modes
The container uses entrypoint.sh and supports two main modes:
- http: starts the FastAPI app.
- celery: starts the Celery worker.
Build local/test target (installs all dependency groups):
docker build --target local_test -t comment-automation:local .
Build production target (installs only non-dev dependencies):
docker build --target production -t comment-automation:prod .
Run HTTP app (default mode):
docker run --rm -p 8000:8000 comment-automation:prod
Run Celery worker mode:
docker run --rm \
-e CELERY_BROKER_URL=redis://host.docker.internal:6379/0 \
-e CELERY_RESULT_BACKEND=redis://host.docker.internal:6379/0 \
comment-automation:prod celery