# A lightweight, source-based build container for Dangerzone
# Builds Dangerzone from source using a minimal Python-based installation
# and runs the CLI by default.
FROM python:3.11-slim
ENV DEBIAN_FRONTEND=noninteractive
# System dependencies (mostly for building and ensuring wheels can be installed)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy dependency management files first to leverage Docker cache
COPY pyproject.toml poetry.lock /app/
# Install project dependencies without using Poetry
RUN python -m pip install --no-cache-dir \
"click" \
"platformdirs" \
"PySide6" \
"PyMuPDF" \
"colorama" \
"pyxdg" \
"requests" \
"markdown" \
"packaging" \
"shiboken6"
# Copy the rest of the source code
COPY . /app
# Install the project itself using setuptools (setup.py)
RUN python -m pip install --no-cache-dir -e .
# Default command: run the CLI help to verify the image
CMD ["dangerzone-cli", "--help"]