Spaces:
Runtime error
Runtime error
File size: 666 Bytes
cb4f124 9864782 cb4f124 9864782 9164962 cb4f124 9864782 f12a1f3 6e3795b cb4f124 9864782 cb4f124 9864782 cb4f124 d6f11c8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# Use the Python 3.9 slim image as the base
FROM python:3.9-slim
# Set working directory inside the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . .
# Install Gunicorn and your application dependencies
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install gunicorn gevent
# Expose the port that Gunicorn will listen on
EXPOSE 7860
# Set environment variables for Flask application
ENV FLASK_APP=app.py
ENV FLASK_RUN_HOST=0.0.0.0
ENV FLASK_RUN_PORT=7860
# Run the Gunicorn server with the appropriate worker class (gthread)
CMD ["gunicorn", "-w", "2", "-k", "gevent", "-b", "0.0.0.0:7860", "app:app"]
|