File size: 581 Bytes
0ec1c2e dae0c02 0ec1c2e dae0c02 0ec1c2e dae0c02 0ec1c2e dae0c02 0ec1c2e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# Use the official Python base image
FROM python:3.9-slim
# Set a working directory
WORKDIR /app
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the Flask application to the container
COPY . .
# Expose the port that the app will run on (Hugging Face Spaces typically uses port 7860)
EXPOSE 7860
# Set environment variables for Flask and Gunicorn
ENV FLASK_APP=app.py
ENV FLASK_RUN_HOST=0.0.0.0
ENV FLASK_RUN_PORT=7860
# Command to run the Flask app with gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|