forked from AnubisLMS/Anubis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (36 loc) · 1.2 KB
/
Copy pathDockerfile
File metadata and controls
43 lines (36 loc) · 1.2 KB
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
34
35
36
37
38
39
40
41
42
43
FROM python:3.10-slim-bullseye
ENV DEBUG=0
ENV MINDEBUG=0
ENV MAX_CONCURRENCY=8
ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
ENV HOME=/home/anubis
WORKDIR /opt/app
COPY requirements/common.txt requirements.txt
RUN apt update \
&& apt install -y make mariadb-client git tzdata gcc g++ libmagic-dev fonts-roboto \
&& pip3 install --no-cache-dir -r ./requirements.txt \
&& useradd -M anubis \
&& chown anubis:anubis -R /opt/app \
&& ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime \
&& apt purge -y gcc g++ \
&& apt autoremove -y \
&& env USER=root find /opt/app -depth \
\( \
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
\) -exec rm -rf '{}' + \
\
&& env USER=root find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
\) -exec rm -rf '{}' + \
&& rm -rf /usr/share/doc \
&& rm -rf /usr/lib/gcc \
&& rm -rf /usr/local/share/.cache \
&& rm -rf /var/cache/apt/* \
&& rm -rf /var/lib/apt/lists/*
USER anubis
COPY . .
USER nobody
CMD ./docker-entrypoint.sh