feat(ci): add Dockerfile and update CI configuration for DAST

Signed-off-by: Klagarge <remi@heredero.ch>
This commit is contained in:
2025-04-13 17:13:46 +02:00
parent 7da76417f7
commit c308ffd2dd
2 changed files with 73 additions and 14 deletions

31
src/Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
FROM python:3.10-slim
LABEL org.opencontainers.image.authors="remi.heredero@hevs.ch"
RUN apt-get update && \
pip install --no-cache-dir -U pdm && \
rm -rf /var/lib/apt/lists/*
ENV PATH="/root/.local/bin:$PATH" \
PDM_USE_VENV=false
WORKDIR /app
COPY src/pyproject.toml src/pdm.lock ./
RUN pdm config python.use_venv false && \
pdm install
ENV PYTHONPATH="/app/__pypackages__/3.9/lib" \
PATH="/app/__pypackages__/3.9/bin:$PATH"
############################################################
# Everything above should be imported from the test image, #
# but GitLab can't pull it, so I copy-paste the content #
############################################################
COPY src ./
ENV FLASK_RUN_HOST=0.0.0.0
CMD ["pdm", "run", "flask"]