mirror of
https://github.com/pretix/pretix.git
synced 2026-05-17 17:14:04 +00:00
Allow to run nginx+gunicorn in Docker container
This commit is contained in:
@@ -30,7 +30,8 @@ RUN apt-get update && \
|
|||||||
mkdir /data && \
|
mkdir /data && \
|
||||||
useradd -ms /bin/bash -d /pretix -u 15371 pretixuser && \
|
useradd -ms /bin/bash -d /pretix -u 15371 pretixuser && \
|
||||||
echo 'pretixuser ALL=(ALL) NOPASSWD:SETENV: /usr/bin/supervisord' >> /etc/sudoers && \
|
echo 'pretixuser ALL=(ALL) NOPASSWD:SETENV: /usr/bin/supervisord' >> /etc/sudoers && \
|
||||||
mkdir /static
|
mkdir /static && \
|
||||||
|
mkdir /etc/supervisord
|
||||||
|
|
||||||
ENV LC_ALL=C.UTF-8 \
|
ENV LC_ALL=C.UTF-8 \
|
||||||
DJANGO_SETTINGS_MODULE=production_settings
|
DJANGO_SETTINGS_MODULE=production_settings
|
||||||
@@ -52,7 +53,9 @@ RUN pip3 install -U \
|
|||||||
rm -rf ~/.cache/pip
|
rm -rf ~/.cache/pip
|
||||||
|
|
||||||
COPY deployment/docker/pretix.bash /usr/local/bin/pretix
|
COPY deployment/docker/pretix.bash /usr/local/bin/pretix
|
||||||
COPY deployment/docker/supervisord.conf /etc/supervisord.conf
|
COPY deployment/docker/supervisord /etc/supervisord
|
||||||
|
COPY deployment/docker/supervisord.all.conf /etc/supervisord.all.conf
|
||||||
|
COPY deployment/docker/supervisord.web.conf /etc/supervisord.web.conf
|
||||||
COPY deployment/docker/nginx.conf /etc/nginx/nginx.conf
|
COPY deployment/docker/nginx.conf /etc/nginx/nginx.conf
|
||||||
COPY deployment/docker/production_settings.py /pretix/src/production_settings.py
|
COPY deployment/docker/production_settings.py /pretix/src/production_settings.py
|
||||||
COPY src /pretix/src
|
COPY src /pretix/src
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ fi
|
|||||||
python3 -m pretix migrate --noinput
|
python3 -m pretix migrate --noinput
|
||||||
|
|
||||||
if [ "$1" == "all" ]; then
|
if [ "$1" == "all" ]; then
|
||||||
exec sudo -E /usr/bin/supervisord -n -c /etc/supervisord.conf
|
exec sudo -E /usr/bin/supervisord -n -c /etc/supervisord.all.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" == "web" ]; then
|
||||||
|
exec sudo -E /usr/bin/supervisord -n -c /etc/supervisord.web.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" == "webworker" ]; then
|
if [ "$1" == "webworker" ]; then
|
||||||
@@ -37,10 +41,6 @@ if [ "$1" == "taskworker" ]; then
|
|||||||
exec celery -A pretix.celery_app worker -l info "$@"
|
exec celery -A pretix.celery_app worker -l info "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" == "shell" ]; then
|
|
||||||
exec python3 -m pretix shell
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$1" == "upgrade" ]; then
|
if [ "$1" == "upgrade" ]; then
|
||||||
exec python3 -m pretix updatestyles
|
exec python3 -m pretix updatestyles
|
||||||
fi
|
fi
|
||||||
|
|||||||
2
deployment/docker/supervisord.all.conf
Normal file
2
deployment/docker/supervisord.all.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[include]
|
||||||
|
files = /etc/supervisord/*.conf
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
[unix_http_server]
|
|
||||||
file=/tmp/supervisor.sock
|
|
||||||
|
|
||||||
[supervisord]
|
|
||||||
logfile=/tmp/supervisord.log
|
|
||||||
logfile_maxbytes=50MB
|
|
||||||
logfile_backups=10
|
|
||||||
loglevel=info
|
|
||||||
pidfile=/tmp/supervisord.pid
|
|
||||||
nodaemon=false
|
|
||||||
minfds=1024
|
|
||||||
minprocs=200
|
|
||||||
|
|
||||||
[rpcinterface:supervisor]
|
|
||||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
|
||||||
|
|
||||||
[supervisorctl]
|
|
||||||
serverurl=unix:///tmp/supervisor.sock
|
|
||||||
|
|
||||||
[program:pretixweb]
|
|
||||||
command=/usr/local/bin/pretix webworker
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
priority=5
|
|
||||||
user=pretixuser
|
|
||||||
environment=HOME=/pretix
|
|
||||||
|
|
||||||
[program:pretixtask]
|
|
||||||
command=/usr/local/bin/pretix taskworker
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
priority=5
|
|
||||||
user=pretixuser
|
|
||||||
|
|
||||||
[program:nginx]
|
|
||||||
command=/usr/sbin/nginx
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
priority=10
|
|
||||||
stdout_events_enabled=true
|
|
||||||
stderr_events_enabled=true
|
|
||||||
|
|
||||||
[include]
|
|
||||||
files = /etc/supervisord-*.conf
|
|
||||||
2
deployment/docker/supervisord.web.conf
Normal file
2
deployment/docker/supervisord.web.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[include]
|
||||||
|
files = /etc/supervisord/base.conf /etc/supervisord/nginx.conf /etc/supervisord/pretixweb.conf
|
||||||
18
deployment/docker/supervisord/base.conf
Normal file
18
deployment/docker/supervisord/base.conf
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[unix_http_server]
|
||||||
|
file=/tmp/supervisor.sock
|
||||||
|
|
||||||
|
[supervisord]
|
||||||
|
logfile=/tmp/supervisord.log
|
||||||
|
logfile_maxbytes=50MB
|
||||||
|
logfile_backups=10
|
||||||
|
loglevel=info
|
||||||
|
pidfile=/tmp/supervisord.pid
|
||||||
|
nodaemon=false
|
||||||
|
minfds=1024
|
||||||
|
minprocs=200
|
||||||
|
|
||||||
|
[rpcinterface:supervisor]
|
||||||
|
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||||
|
|
||||||
|
[supervisorctl]
|
||||||
|
serverurl=unix:///tmp/supervisor.sock
|
||||||
7
deployment/docker/supervisord/nginx.conf
Normal file
7
deployment/docker/supervisord/nginx.conf
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[program:nginx]
|
||||||
|
command=/usr/sbin/nginx
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
priority=10
|
||||||
|
stdout_events_enabled=true
|
||||||
|
stderr_events_enabled=true
|
||||||
6
deployment/docker/supervisord/pretixtask.conf
Normal file
6
deployment/docker/supervisord/pretixtask.conf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[program:pretixtask]
|
||||||
|
command=/usr/local/bin/pretix taskworker
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
priority=5
|
||||||
|
user=pretixuser
|
||||||
7
deployment/docker/supervisord/pretixweb.conf
Normal file
7
deployment/docker/supervisord/pretixweb.conf
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[program:pretixweb]
|
||||||
|
command=/usr/local/bin/pretix webworker
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
priority=5
|
||||||
|
user=pretixuser
|
||||||
|
environment=HOME=/pretix
|
||||||
Reference in New Issue
Block a user