Spaces:
Paused
Paused
| # Use an official Python image as a base | |
| FROM python:3.9-slim | |
| # Set the working directory | |
| WORKDIR /app | |
| # Copy the current directory contents into the container at /app | |
| COPY . /app | |
| # Copy the requirements file into the container | |
| COPY requirements.txt . | |
| # Install dependencies from requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Expose the port Flask will run on (Flask default is 5000) | |
| EXPOSE 5000 | |
| # Set the environment variable for Flask | |
| ENV FLASK_APP=app.py | |
| ENV FLASK_RUN_HOST=0.0.0.0 | |
| ENV FLASK_RUN_PORT=5000 | |
| # Hugging Face requires `flask` to run with specific configurations: | |
| # To run Flask via HuggingFace, you'll need `gunicorn` to be used as below: | |
| CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"] | |