11# syntax=docker/dockerfile:1
22ARG PRETALX_VERSION=main
3- ARG PRETALX_UID=1000
4- ARG PRETALX_GID=1000
53
64# Base image with Python 3.12
75FROM python:3.12-slim as base
@@ -47,16 +45,14 @@ ENV LC_ALL=en_US.UTF-8 \
4745FROM base
4846
4947ARG PRETALX_VERSION
50- ARG PRETALX_UID
51- ARG PRETALX_GID
5248
5349# Clone target pretalx repository
5450WORKDIR /build
5551RUN git clone --depth 1 --branch ${PRETALX_VERSION} https://github.com/COSCUP/pretalx.git .
5652
5753# Install build deps
5854RUN --mount=type=cache,target=/root/.cache/pip \
59- python -m pip install uv && uv pip install --system wheel -Ue ".[dev]"
55+ python -m pip install uv && uv pip install --system wheel psycopg2 redis gunicorn -Ue ".[dev]"
6056
6157RUN --mount=type=cache,target=/root/.cache/pip \
6258 python -m build
@@ -66,10 +62,12 @@ RUN --mount=type=cache,target=/root/.cache/pip \
6662 python -m pip install dist/pretalx*whl
6763
6864# Create pretalx user
69- RUN groupadd -f -g ${PRETALX_GID} pretalx && \
70- useradd -u ${PRETALX_UID} -g ${PRETALX_GID} -m -d /pretalx -s /bin/bash pretalx && \
71- mkdir -p /data/media /data/static /data/logs /public/media /public/static && \
72- chown -R pretalx:pretalx /data /public
65+ RUN mkdir /data && \
66+ mkdir /static && \
67+ groupadd -g 999 pretalx && \
68+ useradd -r -u 999 -g pretalx -d /pretalx -ms /bin/bash pretalx && \
69+ chown -R pretalx:pretalx /data && \
70+ chown -R pretalx:pretalx /static
7371
7472# Create deployment directory
7573RUN mkdir -p /etc/pretalx
@@ -100,28 +98,28 @@ ssl = False\n\
10098#backend = redis://redis:6379/2\n \
10199#broker = redis://redis:6379/3\n \
102100[filesystem]\n \
103- media = /public/media\n \
104- static = /public/static" > /tmp/pretalx.build.cfg
101+ static = /static" > /tmp/pretalx.build.cfg
105102
106103# Set environment to use the temporary config
107104ENV PRETALX_CONFIG_FILE=/tmp/pretalx.build.cfg \
108105 DJANGO_SETTINGS_MODULE=pretalx.settings
109106
110107# Run migrate and rebuild using the default (SQLite) settings
111- RUN python -m pretalx migrate
108+ # RUN python -m pretalx migrate
112109RUN python -m pretalx rebuild --npm-install
113110
114111# Now, copy the real configuration file for runtime
115112COPY --chmod=644 deployment/pretalx.cfg /etc/pretalx/pretalx.cfg
116113ENV PRETALX_CONFIG_FILE=/etc/pretalx/pretalx.cfg
117114
115+
118116WORKDIR /pretalx
119117
120118# Expose ports
121119EXPOSE 8000
122120
123121# Set volumes
124- VOLUME ["/data" , "/public " ]
122+ VOLUME ["/data" , "/static " ]
125123
126124# Health check
127125HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
0 commit comments