Skip to content

Commit 02cdb19

Browse files
author
Ware, Joseph (DLSLtd,RAL,LSCI)
committed
Add debugpy to Dockerfile for service containers
1 parent 1357917 commit 02cdb19

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

template/Dockerfile.jinja

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ FROM developer AS build
1717
COPY . /context
1818
WORKDIR /context
1919
RUN touch dev-requirements.txt && pip install -c dev-requirements.txt .
20+
RUN pip install debugpy
2021

2122
# The runtime stage copies the built venv into a slim runtime container
2223
FROM python:${PYTHON_VERSION}-slim AS runtime
23-
# Add apt-get system dependecies for runtime here if needed
24+
# Add apt-get system dependencies for runtime here if needed
2425
COPY --from=build /venv/ /venv/
2526
ENV PATH=/venv/bin:$PATH
2627

27-
# change this entrypoint if it is not the same as the repo
28-
ENTRYPOINT ["{{ repo_name }}"]
29-
CMD ["--version"]{% endif %}
28+
# change CMD if it is not the same as the repo
29+
ENTRYPOINT ["python" "-m"]
30+
# Allows for modifying the ENTRYPOINT for debugging, e.g.
31+
#ENTRYPOINT ["python", "-m", "debugpy", "-m"]
32+
CMD ["{{ repo_name }}", "--version"]{% endif %}

0 commit comments

Comments
 (0)