diff --git a/compose.yml b/compose.yml index da8235d4..06a6274d 100644 --- a/compose.yml +++ b/compose.yml @@ -20,7 +20,7 @@ services: <<: *common ports: - 8000:8000 - command: ["entrypoint.sh", "dev"] + command: ["docker-entrypoint.sh", "dev"] healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/healthcheck"] interval: 10s @@ -29,11 +29,11 @@ services: celery_worker: <<: *common - command: ["entrypoint.sh", "celery_worker"] + command: ["docker-entrypoint.sh", "worker"] celery_beat: <<: *common - command: ["entrypoint.sh", "celery_beat"] + command: ["docker-entrypoint.sh", "beat"] db: image: postgres:15 diff --git a/docker/bin/docker-entrypoint.sh b/docker/bin/docker-entrypoint.sh index 0ce09c78..d76cfe34 100755 --- a/docker/bin/docker-entrypoint.sh +++ b/docker/bin/docker-entrypoint.sh @@ -37,10 +37,11 @@ case "$1" in exec uwsgi --ini /conf/uwsgi.ini ;; worker) - exec celery -A hope_dedup_engine.celery worker -E --loglevel=ERROR --concurrency=4 + export C_FORCE_ROOT=1 + exec celery -A hope_dedup_engine.config.celery worker -E --loglevel=ERROR --concurrency=4 ;; beat) - exec celery -A hope_dedup_engine.celery beat -E --loglevel=ERROR ---scheduler django_celery_beat.schedulers:DatabaseScheduler + exec celery -A hope_dedup_engine.config.celery beat --loglevel=ERROR --scheduler django_celery_beat.schedulers:DatabaseScheduler ;; dev) until pg_isready -h db -p 5432; diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh deleted file mode 100755 index 88299244..00000000 --- a/docker/entrypoint.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -set -eou pipefail - -production() { - uwsgi \ - --http :8000 \ - --master \ - --module=hope_dedup_engine.config.wsgi \ - --processes=2 \ - --buffer-size=8192 -} - -if [ $# -eq 0 ]; then - production -fi - -case "$1" in - dev) - wait-for-it.sh db:5432 - ./manage.py upgrade - ./manage.py runserver 0.0.0.0:8000 - ;; - prd) - tail -f /dev/null - production - ;; - celery_worker) - export C_FORCE_ROOT=1 - celery -A hope_dedup_engine.config.celery worker -l info - ;; - celery_beat) - celery -A hope_dedup_engine.config.celery beat -l info - ;; - *) - exec "$@" - ;; -esac \ No newline at end of file