FROM python:3.9-slim | |
WORKDIR /app | |
# install gcc so that any C-extensions (if needed) can build | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends build-essential \ | |
&& rm -rf /var/lib/apt/lists/* | |
# install Python deps | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# copy your app | |
COPY . . | |
# expose the port | |
EXPOSE 7860 | |
# run with gunicorn | |
CMD ["gunicorn", "--workers", "2", "--timeout", "120", "--bind", "0.0.0.0:7860", "app:app"] | |