-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.prod
More file actions
39 lines (29 loc) · 963 Bytes
/
Dockerfile.prod
File metadata and controls
39 lines (29 loc) · 963 Bytes
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
FROM python:3.11-slim AS runtime
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_NO_CACHE_DIR=on
WORKDIR /app
# System deps kept minimal; Ghostscript is required for font outline/embed
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
ghostscript \
&& rm -rf /var/lib/apt/lists/*
# Copy and install Python deps
COPY requirements.txt ./
RUN pip install --upgrade pip && pip install -r requirements.txt
# Copy application code
COPY app ./app
COPY main.py ./main.py
COPY gunicorn_conf.py ./gunicorn_conf.py
COPY scripts/start.sh ./scripts/start.sh
# App dirs
RUN mkdir -p /app/uploads /app/outputs /app/temp \
&& chmod +x /app/scripts/start.sh \
&& adduser --disabled-password --gecos '' appuser \
&& chown -R appuser:appuser /app
USER appuser
EXPOSE 8000
# Default PORT if platform doesn't inject it
ENV PORT=8000
ENTRYPOINT ["/app/scripts/start.sh"]