From 5b48167c669ea4a7532ff9b1a135c0084ce2359e Mon Sep 17 00:00:00 2001 From: Flo Ha Date: Thu, 19 Feb 2026 18:31:17 +0100 Subject: [PATCH] replace pip with uv --- Dockerfile | 6 +++--- entrypoint.sh | 2 ++ pyproject.toml | 16 ++++++++++++++++ requirements.txt | 3 --- 4 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile index 86c417b..790fb41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM python:3.14-alpine ENV PYTHONUNBUFFERED=1 +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/ WORKDIR /code/ -COPY requirements.txt . -RUN pip install --upgrade pip && \ - pip install --no-cache-dir --requirement requirements.txt +COPY pyproject.toml . +RUN uv venv && uv pip install -r pyproject.toml COPY . . ENTRYPOINT ["./entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index aee4d41..94d3f3a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,8 @@ #!/usr/bin/env sh set -e +. .venv/bin/activate + if [ "$DJANGO_PRODUCTION_MODE" = "true" ]; then echo "starting production server ..." gunicorn --bind=0.0.0.0:8000 --workers=2 gaehsnitzproject.wsgi diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0350ddc --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,16 @@ +[project] +name = "gaehsnitz" +version = "0.1.0" +requires-python = ">=3.14" +dependencies = [ + "django==6.0.2", + "gunicorn==23.0.0", + "psycopg[binary]==3.3.3", +] + +[tool.ruff] +target-version = "py314" +line-length = 120 + +[tool.ruff.lint] +select = ["E", "F", "W", "I"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index cdc38ff..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -django==6.0.2 -gunicorn==23.0.0 -psycopg[binary]==3.3.3