FROM python:3.12-slim@sha256:5e2bdb1b0d542d5039cffb8181c65930093949194a65c365dfb1b0fe13a4fa5b
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
WORKDIR /app
COPY pilot/requirements.lock /tmp/requirements.lock
RUN pip install --no-cache-dir -r /tmp/requirements.lock
COPY pyproject.toml README.md LICENSE ./
COPY domain_oss ./domain_oss
COPY pilot ./pilot
COPY deploy ./deploy
COPY tests ./tests
RUN chmod -R a+rX /app && pip install --no-cache-dir --no-deps .
COPY pilot-source.tar.gz /app/pilot-source.tar.gz
LABEL org.opencontainers.image.source="https://github.com/DigitalPlatDev/Domain-OSS" \
      org.opencontainers.image.revision="7eac16f470a1890b6cdc70abe272771879665bb6" \
      org.opencontainers.image.version="2026-11-20.6-mail" \
      org.flowtech.project="dns-panel"
USER 10001:10001
CMD ["gunicorn", "--workers", "2", "--bind", "0.0.0.0:8080", "domain_oss:create_app()"]
