35 lines
946 B
Docker
35 lines
946 B
Docker
# Ubuntu slim base
|
|
FROM ubuntu:24.04
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
PYTHONUNBUFFERED=1 \
|
|
VIRTUAL_ENV=/opt/venv \
|
|
LANG=C.UTF-8 LC_ALL=C.UTF-8 \
|
|
PATH="/opt/venv/bin:$PATH"
|
|
|
|
# copy only requirements first so pip install can be cached
|
|
COPY app/requirements.txt /app/requirements.txt
|
|
|
|
# Minimal runtime: python3 + nmap (+ ca certs/tzdata), clean apt cache
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
python3 python3-venv python3-pip \
|
|
nmap ca-certificates tzdata wkhtmltopdf fonts-dejavu ca-certificates && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Debug Print version of wkhtmltopdf
|
|
RUN wkhtmltopdf --version
|
|
|
|
# ---- Create & activate venv ----
|
|
RUN python3 -m venv $VIRTUAL_ENV
|
|
|
|
# ---- Install Python deps into venv ----
|
|
RUN pip install --no-cache-dir -r /app/requirements.txt
|
|
|
|
# ---- App code ----
|
|
WORKDIR /app
|
|
COPY app/ /app/
|
|
|
|
# Default command
|
|
ENTRYPOINT ["python3", "/app/main.py"]
|