diff options
| author | Kyle Javier [kj_sh604] | 2026-03-11 23:33:09 -0400 |
|---|---|---|
| committer | GitHub | 2026-03-11 23:33:09 -0400 |
| commit | 3ec602df2defbe06e1faf6202e2529e890ad4348 (patch) | |
| tree | b1f30220ff10de5057b1639b39696ceebf263cf5 /Dockerfile | |
| parent | bee95cc07ab1e68fb1aee42a42d5bc01e039f883 (diff) | |
| parent | db51a5321bbc6f8731fa040e305efdbf727a99e0 (diff) | |
merge: pull request #2 from kj-sh604/refactor/unf**k-rewrite
refactor: unfuck the codebase into something more maintainable and better overall
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 40 |
1 files changed, 27 insertions, 13 deletions
@@ -1,23 +1,37 @@ -FROM ubuntu:24.04 - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && apt-get install -y \ - nim \ - build-essential \ - pandoc \ - texlive-full \ +FROM python:3.12-slim + +ENV DEBIAN_FRONTEND=noninteractive \ + PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + PORT=5001 \ + HOST=0.0.0.0 \ + LOG_LEVEL=INFO \ + TRUST_PROXY=1 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + libcairo2 \ + libpango-1.0-0 \ + libpangocairo-1.0-0 \ + libgdk-pixbuf-2.0-0 \ + shared-mime-info \ + fonts-noto \ fonts-noto-color-emoji \ && rm -rf /var/lib/apt/lists/* WORKDIR /app -COPY src/ . +RUN addgroup --system app && adduser --system --ingroup app app -RUN nim c -d:release --opt:size -o:likha-pdf app.nim +COPY requirements.txt . +RUN pip install --no-cache-dir --disable-pip-version-check -r requirements.txt + +COPY src/ . RUN mkdir -p generated uploads -EXPOSE 5000 +RUN chown -R app:app /app +USER app + +EXPOSE 5001 -CMD ["./likha-pdf"] +CMD ["gunicorn", "--bind", "0.0.0.0:5001", "--workers", "2", "--threads", "4", "--timeout", "180", "--graceful-timeout", "30", "--access-logfile", "-", "--error-logfile", "-", "app:app"] |
