-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (19 loc) · 808 Bytes
/
Dockerfile
File metadata and controls
24 lines (19 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.11
# Install debugging tools
RUN apt-get update && apt-get install -y --no-install-recommends \
strace \
gdb \
procps \
curl \
&& rm -rf /var/lib/apt/lists/*
# Download the CPython GDB extension matching this Python version
RUN PYVER=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}')") && \
curl -sSL -o /usr/local/bin/python3-gdb.py \
"https://raw.githubusercontent.com/python/cpython/v${PYVER}/Tools/gdb/libpython.py" && \
echo "add-auto-load-safe-path /usr/local/bin" >> /root/.gdbinit && \
echo "source /usr/local/bin/python3-gdb.py" >> /root/.gdbinit
WORKDIR /app
COPY app.py .
EXPOSE 8080
# Use exec form so python is PID 1 (easy to strace/gdb attach)
CMD ["python3", "-u", "app.py"]