suna/backend/docker/Dockerfile

24 lines
759 B
Docker
Raw Normal View History

2025-04-18 10:22:35 +08:00
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
2025-04-25 05:15:40 +08:00
RUN pip install --no-cache-dir gunicorn
# Copy the .env file first
COPY .env .
2025-04-18 10:22:35 +08:00
# Copy the backend code
COPY . .
# Set environment variable
ENV PYTHONPATH=/app
2025-04-24 08:45:58 +08:00
ENV ENV_MODE="production"
2025-04-18 10:22:35 +08:00
# Expose the port the app runs on
EXPOSE 8000
2025-04-23 12:14:43 +08:00
# Command to run the application with Uvicorn directly
2025-04-25 05:15:40 +08:00
CMD ["gunicorn", "api:app", "--workers", "24", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:8000", "--timeout", "600", "--graceful-timeout", "300", "--keep-alive", "250", "--max-requests", "0", "--max-requests-jitter", "0", "--forwarded-allow-ips", "*", "--worker-connections", "5000", "--worker-tmp-dir", "/dev/shm", "--preload"]