File size: 547 Bytes
5595924 037cd0b 5595924 037cd0b 5595924 037cd0b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# Use official Python runtime as base image
FROM python:3.11-slim
# Set working directory in container
WORKDIR /app
# Copy requirements file
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY app.py .
# Expose port 7860
EXPOSE 7860
# Set environment variables (can be overridden at runtime)
ENV PYTHONUNBUFFERED=1
ENV FLASK_APP=app.py
# Run the application with gunicorn for production
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "4", "app:app"] |