Skip to content
Open
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
6 changes: 5 additions & 1 deletion Dockerfile.ecs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ COPY . .
# Set Python path
ENV PYTHONPATH="${PYTHONPATH}:/app/ai_ta_backend"

# Sensible defaults for worker recycling; override via task env if needed
ENV GUNICORN_MAX_REQUESTS=1000
ENV GUNICORN_MAX_REQUESTS_JITTER=200

# Expose port
EXPOSE 8001

Expand All @@ -40,4 +44,4 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8001/health || exit 1

# Run the application
CMD ["gunicorn", "--workers=2", "--threads=3", "--worker-class=gthread", "ai_ta_backend.main:app", "--timeout=1800", "--bind=0.0.0.0:8001"]
CMD ["gunicorn", "--workers=2", "--threads=3", "--worker-class=gthread", "ai_ta_backend.main:app", "--timeout=1800", "--bind=0.0.0.0:8001", "--max-requests", "${GUNICORN_MAX_REQUESTS}", "--max-requests-jitter", "${GUNICORN_MAX_REQUESTS_JITTER}"]
6 changes: 5 additions & 1 deletion Self-Hosted-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ COPY . .
# Set the Python path to include the ai_ta_backend directory
ENV PYTHONPATH="${PYTHONPATH}:/usr/src/app/ai_ta_backend"

# Sensible defaults for worker recycling; override at runtime if desired
ENV GUNICORN_MAX_REQUESTS=1000
ENV GUNICORN_MAX_REQUESTS_JITTER=200

# Make port 8001 available to the world outside this container
EXPOSE 8001

# Run the application using Gunicorn with specified configuration
CMD ["gunicorn", "--workers=2", "--threads=3", "--worker-class=gthread", "ai_ta_backend.main:app", "--timeout=1800", "--bind=0.0.0.0:8001"]
CMD ["gunicorn", "--workers=2", "--threads=3", "--worker-class=gthread", "ai_ta_backend.main:app", "--timeout=1800", "--bind=0.0.0.0:8001", "--max-requests", "${GUNICORN_MAX_REQUESTS}", "--max-requests-jitter", "${GUNICORN_MAX_REQUESTS_JITTER}"]