Spaces:
Runtime error
Runtime error
| # Use an official Python runtime as a parent image | |
| FROM python:3.9-slim | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Set environment variables to prevent Python from writing .pyc files and to buffer output | |
| ENV PYTHONDONTWRITEBYTECODE 1 | |
| ENV PYTHONUNBUFFERED 1 | |
| # Copy the requirements file into the container at /app | |
| COPY requirements.txt . | |
| # Install the dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of the application source code into the container at /app | |
| COPY . . | |
| # Expose port 8080 to allow communication to/from the container | |
| EXPOSE 7860 | |
| # Define the command to run the application | |
| # Use Gunicorn as the production server with Uvicorn workers | |
| CMD ["gunicorn", "--workers", "4", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:8080", "ebapi:app"] | |