-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 898 Bytes
/
Dockerfile
File metadata and controls
33 lines (23 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:3.8-slim-buster
LABEL mantainer="alfred richardsn <rchrdsn@protonmail.ch>"
ARG ESCROW_ENABLED
RUN if test "$ESCROW_ENABLED" = true; then \
apt-get update && apt-get install --yes --no-install-recommends git; \
else exit 0; fi
ARG USER=tellerbot
ARG GROUP=tellerbot
ENV HOME /home/$USER
RUN groupadd -g 999 $GROUP \
&& useradd -g $GROUP -u 999 -l -s /sbin/nologin -m -d $HOME $USER
WORKDIR $HOME
USER $USER:$GROUP
COPY --chown=999:999 requirements.txt requirements-escrow.txt ./
ENV PATH $PATH:$HOME/.local/bin
RUN pip install --user --no-cache-dir --requirement requirements.txt \
&& if test "$ESCROW_ENABLED" = true; then \
pip install --user --no-cache-dir --requirement requirements-escrow.txt; \
else exit 0; fi
COPY --chown=999:999 locale/ locale/
RUN pybabel compile --directory=locale/ --domain=bot
COPY --chown=999:999 . .
ENTRYPOINT ["python", "."]