Skip to content

Commit 5574ee6

Browse files
committed
Remove python dev
1 parent 84c3d57 commit 5574ee6

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/fastapi/docker_files.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ RUN : \
484484
&& apt-get update \
485485
&& apt-get install -y --no-install-recommends \
486486
python{python_version} \
487-
python{python_version}-dev \
488487
&& apt-get clean \
489488
&& rm -rf /var/lib/apt/lists/*
490489
@@ -717,7 +716,6 @@ RUN : \
717716
&& apt-get update \
718717
&& apt-get install -y --no-install-recommends \
719718
python{python_version} \
720-
python{python_version}-dev \
721719
python{python_version}-venv \
722720
&& apt-get clean \
723721
&& rm -rf /var/lib/apt/lists/*

src/fastapi/snapshots/python_project__fastapi__docker_files__tests__save_dockerfile_maturin_setuptools.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: src/fastapi/docker_files.rs
33
expression: content
44
---
5-
"# syntax=docker/dockerfile:1\n\nFROM ubuntu:24.04 AS builder\n\nWORKDIR /app\n\nENV \\\n PYTHONUNBUFFERED=true \\\n UV_PYTHON_INSTALL_DIR=/opt/uv/python \\\n UV_LINK_MODE=copy\n\nRUN : \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends \\\n build-essential \\\n curl \\\n ca-certificates \\\n libssl-dev \\\n pkg-config \\\n software-properties-common \\\n && add-apt-repository ppa:deadsnakes/ppa \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends \\\n python3.11 \\\n python3.11-dev \\\n python3.11-venv \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/*\n\n# Install uv\nADD https://astral.sh/uv/install.sh /uv-installer.sh\n\nRUN sh /uv-installer.sh && rm /uv-installer.sh\n\n# Install rust\nRUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal\n\nENV PATH=\"/root/.local/bin:/root/.cargo/bin:$PATH\"\n\n# Create virtual environment\nRUN python3.11 -m venv .venv\n\nCOPY pyproject.toml Cargo.toml Cargo.lock README.md LICENSE ./\nCOPY src/ ./src\nRUN mkdir my_project\n\nRUN --mount=type=cache,target=/app/target/ \\\n --mount=type=cache,target=/usr/local/cargo/git/db \\\n --mount=type=cache,target=/usr/local/cargo/registry/ \\\n uv tool run maturin develop -r\n\nCOPY requirements.txt ./\n\nRUN --mount=type=cache,target=/root/.cache/uv \\\n .venv/bin/python -m pip install -r requirements.txt\n\nCOPY . /app\n\n\nRUN --mount=type=cache,target=/usr/local/cargo/git/db \\\n --mount=type=cache,target=/usr/local/cargo/registry/ \\\n .venv/bin/python -m pip install -r requirements.txt \\\n && uv tool run maturin develop -r\n\n\n# Build production stage\nFROM ubuntu:24.04 AS prod\n\nRUN useradd appuser\n\nWORKDIR /app\n\nRUN chown appuser:appuser /app\n\nENV \\\n PYTHONUNBUFFERED=true \\\n PATH=\"/app/.venv/bin:$PATH\" \\\n PORT=\"8000\"\n\nRUN : \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends \\\n software-properties-common \\\n && add-apt-repository ppa:deadsnakes/ppa \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends \\\n python3.11 \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/*\n\nCOPY --from=builder /app/.venv /app/.venv\nCOPY --from=builder /app/my_project /app/my_project\nCOPY ./scripts/entrypoint.sh /app\n\nRUN chmod +x /app/entrypoint.sh\n\nEXPOSE 8000\n\nUSER appuser\n\nENTRYPOINT [\"./entrypoint.sh\"]\n"
5+
"# syntax=docker/dockerfile:1\n\nFROM ubuntu:24.04 AS builder\n\nWORKDIR /app\n\nENV \\\n PYTHONUNBUFFERED=true \\\n UV_PYTHON_INSTALL_DIR=/opt/uv/python \\\n UV_LINK_MODE=copy\n\nRUN : \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends \\\n build-essential \\\n curl \\\n ca-certificates \\\n libssl-dev \\\n pkg-config \\\n software-properties-common \\\n && add-apt-repository ppa:deadsnakes/ppa \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends \\\n python3.11 \\\n python3.11-venv \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/*\n\n# Install uv\nADD https://astral.sh/uv/install.sh /uv-installer.sh\n\nRUN sh /uv-installer.sh && rm /uv-installer.sh\n\n# Install rust\nRUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal\n\nENV PATH=\"/root/.local/bin:/root/.cargo/bin:$PATH\"\n\n# Create virtual environment\nRUN python3.11 -m venv .venv\n\nCOPY pyproject.toml Cargo.toml Cargo.lock README.md LICENSE ./\nCOPY src/ ./src\nRUN mkdir my_project\n\nRUN --mount=type=cache,target=/app/target/ \\\n --mount=type=cache,target=/usr/local/cargo/git/db \\\n --mount=type=cache,target=/usr/local/cargo/registry/ \\\n uv tool run maturin develop -r\n\nCOPY requirements.txt ./\n\nRUN --mount=type=cache,target=/root/.cache/uv \\\n .venv/bin/python -m pip install -r requirements.txt\n\nCOPY . /app\n\n\nRUN --mount=type=cache,target=/usr/local/cargo/git/db \\\n --mount=type=cache,target=/usr/local/cargo/registry/ \\\n .venv/bin/python -m pip install -r requirements.txt \\\n && uv tool run maturin develop -r\n\n\n# Build production stage\nFROM ubuntu:24.04 AS prod\n\nRUN useradd appuser\n\nWORKDIR /app\n\nRUN chown appuser:appuser /app\n\nENV \\\n PYTHONUNBUFFERED=true \\\n PATH=\"/app/.venv/bin:$PATH\" \\\n PORT=\"8000\"\n\nRUN : \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends \\\n software-properties-common \\\n && add-apt-repository ppa:deadsnakes/ppa \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends \\\n python3.11 \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/*\n\nCOPY --from=builder /app/.venv /app/.venv\nCOPY --from=builder /app/my_project /app/my_project\nCOPY ./scripts/entrypoint.sh /app\n\nRUN chmod +x /app/entrypoint.sh\n\nEXPOSE 8000\n\nUSER appuser\n\nENTRYPOINT [\"./entrypoint.sh\"]\n"

src/fastapi/snapshots/python_project__fastapi__docker_files__tests__save_dockerfile_poetry.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: src/fastapi/docker_files.rs
33
expression: content
44
---
5-
"# syntax=docker/dockerfile:1\n\nFROM ubuntu:24.04 AS builder\n\nWORKDIR /app\n\nENV \\\n PYTHONUNBUFFERED=true \\\n POETRY_NO_INTERACTION=true \\\n POETRY_VIRTUALENVS_IN_PROJECT=true \\\n POETRY_CACHE_DIR=/tmp/poetry_cache\n\nRUN : \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends \\\n build-essential \\\n curl \\\n ca-certificates \\\n software-properties-common \\\n && add-apt-repository ppa:deadsnakes/ppa \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends \\\n python3.11 \\\n python3.11-dev \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/*\n\n# Install Poetry\nRUN curl -sSL https://install.python-poetry.org | python3.11 -\n\nENV PATH=\"/root/.local/bin:$PATH\"\n\nCOPY pyproject.toml poetry.lock ./\n\nCOPY . ./\n\nRUN --mount=type=cache,target=$POETRY_CACHE_DIR \\\n poetry config virtualenvs.in-project true \\\n && poetry install --only=main\n\n\n# Build production stage\nFROM ubuntu:24.04 AS prod\n\nRUN useradd appuser\n\nWORKDIR /app\n\nRUN chown appuser:appuser /app\n\nENV \\\n PYTHONUNBUFFERED=true \\\n PATH=\"/app/.venv/bin:$PATH\" \\\n PORT=\"8000\"\n\nRUN : \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends\\\n software-properties-common \\\n && add-apt-repository ppa:deadsnakes/ppa \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends python3.11 \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/*\n\nCOPY --from=builder /app/.venv /app/.venv\nCOPY --from=builder /app/my_project /app/my_project\nCOPY ./scripts/entrypoint.sh /app\n\nRUN chmod +x /app/entrypoint.sh\n\nEXPOSE 8000\n\nUSER appuser\n\nENTRYPOINT [\"./entrypoint.sh\"]\n"
5+
"# syntax=docker/dockerfile:1\n\nFROM ubuntu:24.04 AS builder\n\nWORKDIR /app\n\nENV \\\n PYTHONUNBUFFERED=true \\\n POETRY_NO_INTERACTION=true \\\n POETRY_VIRTUALENVS_IN_PROJECT=true \\\n POETRY_CACHE_DIR=/tmp/poetry_cache\n\nRUN : \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends \\\n build-essential \\\n curl \\\n ca-certificates \\\n software-properties-common \\\n && add-apt-repository ppa:deadsnakes/ppa \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends \\\n python3.11 \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/*\n\n# Install Poetry\nRUN curl -sSL https://install.python-poetry.org | python3.11 -\n\nENV PATH=\"/root/.local/bin:$PATH\"\n\nCOPY pyproject.toml poetry.lock ./\n\nCOPY . ./\n\nRUN --mount=type=cache,target=$POETRY_CACHE_DIR \\\n poetry config virtualenvs.in-project true \\\n && poetry install --only=main\n\n\n# Build production stage\nFROM ubuntu:24.04 AS prod\n\nRUN useradd appuser\n\nWORKDIR /app\n\nRUN chown appuser:appuser /app\n\nENV \\\n PYTHONUNBUFFERED=true \\\n PATH=\"/app/.venv/bin:$PATH\" \\\n PORT=\"8000\"\n\nRUN : \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends\\\n software-properties-common \\\n && add-apt-repository ppa:deadsnakes/ppa \\\n && apt-get update \\\n && apt-get install -y --no-install-recommends python3.11 \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/*\n\nCOPY --from=builder /app/.venv /app/.venv\nCOPY --from=builder /app/my_project /app/my_project\nCOPY ./scripts/entrypoint.sh /app\n\nRUN chmod +x /app/entrypoint.sh\n\nEXPOSE 8000\n\nUSER appuser\n\nENTRYPOINT [\"./entrypoint.sh\"]\n"

0 commit comments

Comments
 (0)