diff --git a/docker-compose-proxy.yml b/docker-compose-proxy.yml index f477152..7eb7c26 100644 --- a/docker-compose-proxy.yml +++ b/docker-compose-proxy.yml @@ -4,6 +4,8 @@ services: app: build: context: . + healthcheck: + test: ["CMD-SHELL", "uwsgi-is-ready --stats-socket /tmp/statsock > /dev/null 2>&1 || exit 1"] volumes: - ./app:/app - static_data:/vol/web @@ -24,8 +26,7 @@ services: depends_on: - app healthcheck: - test: ["CMD-SHELL", "curl -so /dev/null http://localhost:8000/ || exit 1"] - timeout: 10s + test: ["CMD-SHELL", "curl -so /dev/null http://localhost:8000/health || exit 1"] ports: - "8000:8000" volumes: diff --git a/requirements.txt b/requirements.txt index 5ce9ceb..f24bab0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,4 @@ psycopg2>=2.7.5,<2.8.0 Pillow>=5.3.0,<5.4.0 uwsgi>=2.0.18,<2.1.0 flake8>=3.6.0,<3.7.0 +uwsgi-readiness-check diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index a0c5063..01c2f2d 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -4,4 +4,4 @@ set -e python manage.py collectstatic --noinput python manage.py wait_for_db python manage.py migrate -uwsgi --socket :9000 --workers 4 --master --enable-threads --module app.wsgi +uwsgi --socket :9000 --workers 4 --master --enable-threads --module app.wsgi --stats /tmp/statsock