-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDockerfile.web
More file actions
42 lines (32 loc) · 1.13 KB
/
Copy pathDockerfile.web
File metadata and controls
42 lines (32 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM python:3.13-slim AS base
# Setup env
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONFAULTHANDLER=1
# Install compilation dependencies
RUN apt-get update && apt-get install -y --no-install-recommends gcc git && rm -rf /var/lib/apt/lists/*
FROM base AS runtime
COPY --from=ghcr.io/astral-sh/uv:0.12.7@sha256:9e049ccf355e1c6d11416ba84760b4af443e5d2f0d45867c03b36744beb6ee22 /usr/local/bin/uv /usr/local/bin/uv
# Create and switch to a new user
RUN useradd --create-home appuser
WORKDIR /home/appuser
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-build --no-binary-package django-memoize --no-dev
# Install application into container
COPY extralifeapi extralifeapi
COPY fforg fforg
COPY ffstream ffstream
COPY ffdonations ffdonations
COPY ffsite ffsite
COPY eventer eventer
COPY evtsignup evtsignup
COPY ffoverlay ffoverlay
COPY ffbot ffbot
COPY ffdiscord ffdiscord
COPY templates templates
COPY manage.py .
RUN chown -R appuser /home/appuser
USER appuser
RUN uv run --no-sync --no-build python manage.py collectstatic --no-input
CMD [ "uv", "run", "--no-sync", "--no-build", "gunicorn", "fforg.wsgi" ]