diff options
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index cb2b9df..0000000 --- a/Dockerfile +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | FROM python:3.12-slim | ||
| 2 | |||
| 3 | # enable contrib (fonts-ibm-plex) and non-free (fonts-ubuntu) components | ||
| 4 | RUN sed -i 's/^Components: main$/Components: main contrib non-free/' /etc/apt/sources.list.d/debian.sources | ||
| 5 | |||
| 6 | # install fonts, fontconfig (for fc-list), libmagic1 (for python-magic), and tini | ||
| 7 | RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| 8 | tini \ | ||
| 9 | fontconfig \ | ||
| 10 | libmagic1 \ | ||
| 11 | fonts-dejavu fonts-dejavu-core fonts-dejavu-extra fonts-dejavu-mono fonts-liberation fonts-liberation2 fonts-opensymbol fonts-urw-base35 fonts-noto-color-emoji fonts-noto-core fonts-noto-ui-core fonts-noto-extra fonts-noto-mono fonts-noto-cjk fonts-noto-cjk-extra fonts-roboto fonts-roboto-slab fonts-lato fonts-open-sans fonts-quicksand fonts-comfortaa fonts-cantarell fonts-beteckna fonts-ubuntu fonts-linuxlibertine fonts-ebgaramond fonts-ebgaramond-extra fonts-junicode fonts-stix fonts-texgyre fonts-sil-gentium fonts-sil-gentium-basic fonts-hack fonts-firacode fonts-cascadia-code fonts-inconsolata fonts-fantasque-sans fonts-terminus fonts-droid-fallback fonts-symbola fonts-ancient-scripts fonts-mathjax fonts-croscore fonts-nanum fonts-nanum-extra fonts-wqy-microhei fonts-wqy-zenhei fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-gothic fonts-ipafont-mincho fonts-indic fonts-lohit-deva fonts-lohit-beng-assamese fonts-lohit-beng-bengali fonts-lohit-gujr fonts-lohit-guru fonts-lohit-knda fonts-lohit-mlym fonts-lohit-orya fonts-lohit-taml fonts-lohit-taml-classical fonts-lohit-telu fonts-smc fonts-arabeyes fonts-hosny-amiri fonts-sil-abyssinica fonts-beng fonts-thai-tlwg fonts-gfs-artemisia fonts-gfs-baskerville fonts-gfs-bodoni-classic fonts-gfs-didot fonts-gfs-gazis fonts-gfs-neohellenic fonts-gfs-olga fonts-gfs-porson fonts-gfs-solomos fonts-gfs-theokritos fonts-crosextra-carlito fonts-crosextra-caladea fonts-cabin fonts-vollkorn fonts-yanone-kaffeesatz fonts-ibm-plex fonts-freefont-ttf fonts-mplus fonts-monofur fonts-courier-prime fonts-anonymous-pro fonts-hermit \ | ||
| 12 | && rm -rf /var/lib/apt/lists/* | ||
| 13 | |||
| 14 | # install Roboto Mono manually (not packaged in Debian, kj_sh604's fave font) | ||
| 15 | RUN apt-get update && apt-get install -y --no-install-recommends curl \ | ||
| 16 | && mkdir -p /usr/local/share/fonts/roboto-mono \ | ||
| 17 | && curl -fsSL "https://cdn.jsdelivr.net/gh/googlefonts/RobotoMono@main/fonts/ttf/RobotoMono-Regular.ttf" \ | ||
| 18 | -o "/usr/local/share/fonts/roboto-mono/RobotoMono-Regular.ttf" \ | ||
| 19 | && fc-cache -fv \ | ||
| 20 | && rm -rf /var/lib/apt/lists/* | ||
| 21 | |||
| 22 | WORKDIR /app | ||
| 23 | |||
| 24 | # install python dependencies | ||
| 25 | COPY src/requirements.txt . | ||
| 26 | RUN pip install --no-cache-dir -r requirements.txt | ||
| 27 | |||
| 28 | # copy entrypoint script | ||
| 29 | COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh | ||
| 30 | RUN chmod +x /usr/local/bin/docker-entrypoint.sh | ||
| 31 | |||
| 32 | # copy application | ||
| 33 | COPY src/ /app/ | ||
| 34 | |||
| 35 | # stash a seed copy of uploads so the entrypoint can populate a fresh volume | ||
| 36 | RUN mkdir -p /opt/uploads-seed \ | ||
| 37 | && cp -r /app/uploads/. /opt/uploads-seed/ \ | ||
| 38 | && chown -R www-data:www-data /app/uploads /opt/uploads-seed | ||
| 39 | |||
| 40 | EXPOSE 3000 | ||
| 41 | |||
| 42 | # tini as PID 1 ensures SIGTERM is properly forwarded to gunicorn, | ||
| 43 | # preventing the 'permission denied' error on docker stop | ||
| 44 | ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/docker-entrypoint.sh"] | ||
| 45 | CMD ["gunicorn", "--bind", "0.0.0.0:3000", "--workers", "2", "--user", "www-data", "--group", "www-data", "app:app"] \ No newline at end of file | ||
