1 FROM python:3.10-trixie AS base
6 RUN apt-get update && apt-get install -y \
11 texlive-xetex texlive-lang-polish \
17 texlive-fonts-extra-links \
18 fonts-noto-core fonts-noto-extra
21 COPY requirements/requirements.txt requirements.txt
23 RUN pip install --no-cache-dir -r requirements.txt
25 RUN wget https://github.com/w3c/epubcheck/releases/download/v5.3.0/epubcheck-5.3.0.zip && \
26 unzip epubcheck-5.3.0.zip && \
27 rm epubcheck-5.3.0.zip && \
28 mv epubcheck-5.3.0 /opt/epubcheck
31 RUN addgroup --gid $GID app && \
32 adduser --gid $GID --home /app --uid $UID app
36 RUN cp -a /usr/local/lib/python*/site-packages/librarian/fonts /usr/share/fonts
47 RUN pip install --no-cache-dir coverage
53 FROM base AS prod-base
57 RUN pip install --no-cache-dir gunicorn
67 FROM prod-base AS static-builder
69 RUN python manage.py collectstatic --noinput
74 FROM nginx:alpine AS nginx
79 # COPY nginx.conf conf.d/...
81 RUN addgroup -g $GID app && addgroup nginx app
82 COPY --from=static-builder /app/src/static /app/var/static
87 FROM prod-base AS prod
89 COPY --from=static-builder /app/src/static/staticfiles.json /app/src/static/staticfiles.json