X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/eb6c65f96fd1b467f4ca1a9e477aa9404574b244..36a196056014e663e57176d1dd70f4a5ad8e56ec:/Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..032024ba7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,57 @@ +FROM python:3.8 AS base + +ARG UID=1000 +ARG GID=1000 + +RUN apt-get update && apt-get install -y \ + 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-luatex \ + texlive-fonts-extra \ + texlive-fonts-extra-links \ + fonts-noto-core fonts-noto-extra + + +USER app + +# fonts +RUN cp -a /usr/local/lib/python*/site-packages/librarian/fonts /app/.fonts +RUN fc-cache + +WORKDIR /app/src + + +FROM base AS dev + +#RUN pip install --no-cache-dir coverage +USER app + + +FROM base AS prod + +RUN pip install --no-cache-dir gunicorn + +USER app +COPY src /app/src