Skip to content

Commit

Permalink
Merge pull request #5 from digorgonzola/uwsgi_health_checks
Browse files Browse the repository at this point in the history
Uwsgi health checks
  • Loading branch information
digorgonzola authored Nov 17, 2023
2 parents 4f57d09 + 8767049 commit 1012ac2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions docker-compose-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1012ac2

Please sign in to comment.