forked from yym68686/uni-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.debug
More file actions
32 lines (24 loc) · 1.01 KB
/
Copy pathDockerfile.debug
File metadata and controls
32 lines (24 loc) · 1.01 KB
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
32
# 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:0.6.10 /uv /uvx /bin/
WORKDIR /home
COPY pyproject.toml uv.lock ./
RUN uv export --frozen --no-dev --no-emit-project --output-file /tmp/requirements.txt && \
uv pip install --system --no-cache -r /tmp/requirements.txt
# 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", "main.py"]