-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathDockerfile.debug
More file actions
31 lines (23 loc) · 990 Bytes
/
Dockerfile.debug
File metadata and controls
31 lines (23 loc) · 990 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
25
26
27
28
29
30
31
# Finale Strategie: Verwendung der gleichen funktionierenden Basis-Images wie für die Produktion
# Stufe 1: Builder - Installiert Abhängigkeiten in die globalen Site-Packages
FROM python:3.11 AS builder
# uv installieren
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
WORKDIR /home
COPY pyproject.toml uv.lock ./
RUN uv pip install -r pyproject.toml --system --no-cache
# Stufe 2: Finales Debug-Image
FROM python:3.11-slim-bullseye
# Installiert NUR die zusätzlichen Debug-Tools
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends gdb python3-dbg && \
rm -rf /var/lib/apt/lists/*
EXPOSE 8000
WORKDIR /home
# Kopiert die installierten Pakete aus dem Builder
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
# Kopiert den Anwendungscode
COPY . .
# Definiert den Entrypoint
ENTRYPOINT ["python3", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]