|
FROM python:3.8.10-slim
|
|
|
|
RUN export DEBIAN_FRONTEND=noninteractive \
|
|
&& apt-get -qq update \
|
|
&& apt install software-properties-common -y \
|
|
&& apt-get install build-essential -y \
|
|
&& python3 --version \
|
|
&& apt update \
|
|
&& apt install ffmpeg -y \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& apt update \
|
|
&& apt install nginx -y
|
|
|
|
|
|
|
|
RUN useradd -m -u 1000 user
|
|
|
|
|
|
USER user
|
|
|
|
|
|
ENV HOME=/home/user \
|
|
PATH=/home/user/.local/bin:$PATH
|
|
|
|
|
|
WORKDIR $HOME/app
|
|
|
|
|
|
COPY requirements.txt requirements.txt
|
|
RUN pip3 install -r requirements.txt
|
|
RUN pip3 install gunicorn
|
|
|
|
|
|
COPY --chown=user app $HOME/app
|
|
|
|
|
|
USER root
|
|
RUN chmod 755 ~/app/*
|
|
USER user
|
|
|
|
|
|
ENTRYPOINT ["python3", "app.py"]
|
|
|
|
|