Some debt.
[wolnelektury.git] / Dockerfile
index 032024b..ed113fe 100644 (file)
@@ -1,4 +1,4 @@
-FROM python:3.8 AS base
+FROM python:3.9-trixie AS base
 
 ARG UID=1000
 ARG GID=1000
 
 ARG UID=1000
 ARG GID=1000
@@ -7,24 +7,6 @@ RUN     apt-get update && apt-get install -y \
        git \
        calibre \
        texlive-xetex texlive-lang-polish \
        git \
        calibre \
        texlive-xetex texlive-lang-polish \
-       libespeak-dev
-
-COPY requirements/requirements.txt requirements.txt
-
-# numpy -> aeneas
-RUN pip install numpy
-RUN pip install aeneas
-
-RUN pip install --no-cache-dir -r requirements.txt
-RUN pip install --no-cache-dir \
-    psycopg2-binary \
-    django-debug-toolbar==3.2.2 \
-    python-bidi
-
-RUN addgroup --gid $GID app
-RUN adduser --gid $GID --home /app --uid $UID app
-
-RUN     apt-get install -y \
        texlive-extra-utils \
        texlive-lang-greek \
        texlive-lang-other \
        texlive-extra-utils \
        texlive-lang-greek \
        texlive-lang-other \
@@ -34,24 +16,34 @@ RUN     apt-get install -y \
        fonts-noto-core fonts-noto-extra
 
 
        fonts-noto-core fonts-noto-extra
 
 
-USER app
+COPY requirements/requirements.txt requirements.txt
+
+RUN pip install --no-cache-dir -r requirements.txt
+RUN pip install --no-cache-dir \
+    psycopg2-binary \
+    django-debug-toolbar==3.2.2
+
+RUN addgroup --gid $GID app && \
+    adduser --gid $GID --home /app --uid $UID app
+
 
 # fonts
 
 # fonts
-RUN cp -a /usr/local/lib/python*/site-packages/librarian/fonts /app/.fonts
+RUN cp -a /usr/local/lib/python*/site-packages/librarian/fonts /usr/share/fonts
 RUN fc-cache
 
 RUN fc-cache
 
+USER app
+
 WORKDIR /app/src
 
 WORKDIR /app/src
 
+RUN mkdir /app/.ipython
 
 FROM base AS dev
 
 #RUN pip install --no-cache-dir coverage
 
 FROM base AS dev
 
 #RUN pip install --no-cache-dir coverage
-USER app
 
 
 FROM base AS prod
 
 RUN pip install --no-cache-dir gunicorn
 
 
 
 FROM base AS prod
 
 RUN pip install --no-cache-dir gunicorn
 
-USER app
 COPY src /app/src
 COPY src /app/src