-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (34 loc) · 1.1 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (34 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Simple PDF — self-hosted PDF merge / clean / edit / OCR
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PDF_EDITOR_HOST=0.0.0.0 \
PDF_EDITOR_PORT=8000 \
PDF_EDITOR_UPLOADS=/app/uploads
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
tesseract-ocr \
tesseract-ocr-eng \
tesseract-ocr-spa \
libreoffice-writer-nogui \
fonts-dejavu-core \
fonts-liberation \
libgl1 \
libglib2.0-0 \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app/ ./app/
COPY static/ ./static/
COPY templates/ ./templates/
COPY wsgi.py .
RUN useradd --create-home --uid 1000 --shell /usr/sbin/nologin appuser \
&& mkdir -p /app/uploads \
&& chown -R appuser:appuser /app
USER appuser
VOLUME ["/app/uploads"]
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -fsS http://127.0.0.1:8000/api/health || exit 1
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "2", "--timeout", "600", "wsgi:app"]