FROM python:3.9-slim-buster # Set the working directory in the container to /app WORKDIR /app # Copy the requirements file COPY requirements.txt . # Install the dependencies RUN pip install -r requirements.txt # Copy the application code COPY . . # chown all the files to the app user and switch to the app user RUN chown -R app:app /app USER app EXPOSE 7860 # Run app.py when the container launches ENTRYPOINT ["gunicorn", "--bind", "0.0.0.0:7860", "app:app", "--timeout=0", "--workers", "2", "--worker-class", "gthread", "--threads", "3"]