-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 931 Bytes
/
Dockerfile
File metadata and controls
40 lines (28 loc) · 931 Bytes
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
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
WAGTAIL_ENV=production \
PORT=8000
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libpq-dev \
default-libmysqlclient-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
RUN pip install uv
RUN uv venv
COPY pyproject.toml .
COPY uv.lock ./
RUN . .venv/bin/activate && uv sync --all-extras
COPY . .
RUN . .venv/bin/activate && python manage.py collectstatic --noinput
RUN adduser --disabled-password --no-create-home wagtailuser
USER wagtailuser
EXPOSE 8000
CMD . .venv/bin/activate && \
export DJANGO_SETTINGS_MODULE=fuhoblog.settings.production DJANGO_FORCEPROD=True && \
python manage.py migrate --noinput && \
.venv/bin/gunicorn --bind 0.0.0.0:8000 \
--workers 4 --access-logfile - --error-logfile - \
--timeout 120 fuhoblog.wsgi:application