-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (48 loc) · 1.53 KB
/
Copy pathDockerfile
File metadata and controls
60 lines (48 loc) · 1.53 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM python:3.11-bookworm
ENV DEBIAN_FRONTEND=noninteractive \
LC_ALL=C.UTF-8 \
DJANGO_SETTINGS_MODULE=production_settings
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gettext \
git \
libffi-dev \
libjpeg-dev \
libmemcached-dev \
libpq-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
locales \
nginx \
nodejs \
npm \
python3-virtualenv \
supervisor \
sudo \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/bash pretixuser
# Copy pretix source
COPY pretix /pretix
# Install pretix
WORKDIR /pretix
RUN pip install --upgrade pip setuptools wheel && \
pip install -e ".[postgres]" && \
pip install gunicorn redis supervisor whitenoise
# Copy production settings alongside pretix
COPY production_settings.py /pretix/src/production_settings.py
# Build static files and frontend assets at build time
RUN mkdir -p /etc/pretix /data/logs /data/media && \
printf '[pretix]\ninstance_name=build\nurl=http://localhost\ncurrency=BRL\ndatadir=/data\n\n[database]\nbackend=sqlite3\n\n[django]\nsecret=build-secret\n' > /etc/pretix/pretix.cfg && \
cd /pretix/src && make production && \
rm /etc/pretix/pretix.cfg
# Copy deployment files
COPY scripts/ /scripts/
COPY supervisord.conf /etc/supervisord.conf
RUN chmod +x /scripts/*.sh
# Create data directories
RUN mkdir -p /data/media /data/logs /etc/pretix && \
chown -R pretixuser:pretixuser /data /etc/pretix /pretix
EXPOSE 8000
CMD ["/scripts/start.sh"]