Minor layout fixes
[wolnelektury.git] / Dockerfile
1 FROM python:3.9-trixie AS base
2
3 ARG UID=1000
4 ARG GID=1000
5
6 RUN     apt-get update && apt-get install -y \
7         git \
8         calibre \
9         texlive-xetex texlive-lang-polish \
10         texlive-extra-utils \
11         texlive-lang-greek \
12         texlive-lang-other \
13         texlive-luatex \
14         texlive-fonts-extra \
15         texlive-fonts-extra-links \
16         fonts-noto-core fonts-noto-extra
17
18
19 COPY requirements/requirements.txt requirements.txt
20
21 RUN pip install --no-cache-dir -r requirements.txt
22 RUN pip install --no-cache-dir \
23     psycopg2-binary \
24     django-debug-toolbar==3.2.2
25
26 RUN addgroup --gid $GID app && \
27     adduser --gid $GID --home /app --uid $UID app
28
29
30 # fonts
31 RUN cp -a /usr/local/lib/python*/site-packages/librarian/fonts /usr/share/fonts
32 RUN fc-cache
33
34 USER app
35
36 WORKDIR /app/src
37
38 RUN mkdir /app/.ipython
39
40
41
42
43 FROM base AS dev
44
45 #RUN pip install --no-cache-dir coverage
46
47
48
49
50 FROM base AS prod
51
52 USER root
53
54 RUN pip install --no-cache-dir gunicorn
55
56 USER app
57
58 COPY src /app/src
59
60
61
62
63 FROM prod AS static-builder
64
65 RUN python manage.py collectstatic --noinput
66
67
68
69 FROM nginx:alpine AS nginx
70
71 # COPY nginx.conf conf.d/...
72
73 COPY --from=static-builder /app/var/static /app/var/static