From b27d2954c205ecd0f80d849e42cf148cf5940d30 Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Tue, 22 Oct 2024 20:34:57 +0200 Subject: [PATCH] Add uv.lock & fix user --- {{cookiecutter.project_slug}}/compose/local/django/Dockerfile | 1 + .../compose/production/django/Dockerfile | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index f387f4579..19b13c8b2 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -18,6 +18,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ # Requirements are installed here to ensure they will be cached. RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ + --mount=type=bind,source=uv.lock,target=uv.lock \ uv sync --no-install-project ADD . ${APP_HOME} diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 1f0bf8a28..0cb65db5e 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -27,6 +27,10 @@ RUN npm run build FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS python-build-stage ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy +ARG APP_HOME=/app + +WORKDIR ${APP_HOME} + # Install apt packages RUN apt-get update && apt-get install --no-install-recommends -y \ # dependencies for building Python packages