Spaces:
Runtime error
Runtime error
# Use Python 3.9 as the base image | |
FROM python:3.9-slim | |
# Set environment variables to avoid writing .pyc files | |
ENV PYTHONUNBUFFERED 1 | |
# Set the working directory in the container | |
WORKDIR /app | |
# Copy the requirements.txt file into the container | |
COPY requirements.txt /app/ | |
# Install dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Install gunicorn | |
RUN pip install gunicorn | |
# Copy the Python client script into the container | |
COPY app.py /app/ | |
# Set the command to run the Python client with gunicorn | |
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8000", "app:app"] | |