helper script
[wolnelektury.git] / Dockerfile
1 FROM python:3.8 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         libespeak-dev
11
12 COPY requirements/requirements.txt requirements.txt
13
14 # numpy -> aeneas
15 RUN pip install numpy
16 RUN pip install aeneas
17
18 RUN pip install --no-cache-dir -r requirements.txt
19 RUN pip install --no-cache-dir \
20     psycopg2-binary \
21     django-debug-toolbar==3.2.2 \
22     python-bidi
23
24 RUN addgroup --gid $GID app
25 RUN adduser --gid $GID --home /app --uid $UID app
26
27 RUN     apt-get install -y \
28         texlive-extra-utils \
29         texlive-lang-greek \
30         texlive-lang-other \
31         texlive-luatex \
32         texlive-fonts-extra \
33         texlive-fonts-extra-links \
34         fonts-noto-core fonts-noto-extra
35
36
37 USER app
38
39 # fonts
40 RUN cp -a /usr/local/lib/python*/site-packages/librarian/fonts /app/.fonts
41 RUN fc-cache
42
43 WORKDIR /app/src
44
45
46 FROM base AS dev
47
48 #RUN pip install --no-cache-dir coverage
49 USER app
50
51
52 FROM base AS prod
53
54 RUN pip install --no-cache-dir gunicorn
55
56 USER app
57 COPY src /app/src