From 75f56ae58ed045f6728d1731ead0804934f6ec15 Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Mon, 24 Jun 2024 15:04:06 +0200 Subject: [PATCH] System Python usage --- Containerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Containerfile b/Containerfile index b0b255c6..d7be1159 100644 --- a/Containerfile +++ b/Containerfile @@ -1,13 +1,14 @@ FROM --platform=linux/amd64 python:3.11 as backend WORKDIR /src ENV PYTHONUNBUFFERED 1 +ENV VIRTUAL_ENV=/usr/local ADD requirements.txt . -RUN python -m venv venv && venv/bin/pip install -U pip && venv/bin/pip install -r requirements.txt +RUN pip install uv && uv pip install -r requirements.txt --system ADD . /src COPY conf/_env .env -RUN venv/bin/python manage.py collectstatic --noinput && rm .env -RUN venv/bin/python -m whitenoise.compress static +RUN python manage.py collectstatic --noinput && rm .env +RUN python -m whitenoise.compress static RUN useradd -U -d /src deploy USER deploy EXPOSE 8000 -CMD ["venv/bin/python", "-m", "gunicorn", "wsgi:application", "-w", "2", "--bind", "0.0.0.0:8000"] +CMD ["python", "-m", "gunicorn", "wsgi:application", "-w", "2", "--bind", "0.0.0.0:8000"]