Do not run the container as root

This commit is contained in:
Aaron Riedel 2022-03-06 09:58:45 +01:00
parent 74425995f7
commit 20437c4899
Signed by: aaron
GPG key ID: 643004654D40D577

View file

@ -1,10 +1,14 @@
FROM python:slim
WORKDIR ./
ARG PUID=1000
ENV USER docker
ENV HOMEDIR "/home/${USER}"
COPY requirements.txt ./
RUN useradd -u "${PUID}" -m "${USER}"
USER ${USER}
WORKDIR ${HOMEDIR}
COPY . .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD [ "python", "./bot.py" ]