Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ COPY . .

RUN python manage.py collectstatic --noinput 2>/dev/null || true

EXPOSE 8000
ENV PORT=8000

EXPOSE ${PORT}

HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:8000/health/ || exit 1
CMD curl -f http://localhost:${PORT}/health/ || exit 1

CMD ["gunicorn", "score.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "4", "--threads", "4", "--timeout", "120"]
CMD sh -c "gunicorn score.wsgi:application --bind 0.0.0.0:${PORT} --workers 4 --threads 4 --timeout 120"
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ services:
web:
build: .
ports:
- "8000:8000"
- "${PORT:-8000}:${PORT:-8000}"
env_file: .env
environment:
- PORT=${PORT:-8000}
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_BROKER_BACKEND=redis
volumes:
Expand Down
Loading