Skip to content

Commit

Permalink
System Python usage
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jun 24, 2024
1 parent 2c53012 commit 75f56ae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 75f56ae

Please sign in to comment.