|
|
|
FROM python:3.9 |
|
|
|
|
|
RUN adduser --disabled-password --gecos "" --uid 1000 user |
|
USER user |
|
ENV PATH="/home/user/.local/bin:${PATH}" |
|
|
|
|
|
USER root |
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
build-essential \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
USER user |
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY --chown=user requirements.txt . |
|
COPY --chown=user gunicorn_config.py . |
|
|
|
|
|
RUN pip install --no-cache-dir --upgrade pip && \ |
|
pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY --chown=user . . |
|
|
|
|
|
ENV PORT=7860 |
|
EXPOSE ${PORT} |
|
|
|
|
|
CMD ["gunicorn", "-c", "gunicorn_config.py", "server:app"] |