Build a Pretix Docker image that can be configured through envinronment variables.
This repository has been archived on 2024-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
Stefan Bethke 7484ab7082
Some checks failed
/ build (push) Failing after 46s
Build image on Forgejo runner
2024-07-30 09:34:56 +02:00
.forgejo/workflows Build image on Forgejo runner 2024-07-30 09:34:56 +02:00
.gitlab-ci.yml Use correct image tags 2023-12-03 12:53:02 +01:00
Dockerfile Fix arg passing to entrypoint 2023-12-03 14:31:24 +01:00
entrypoint.sh Fix arg passing to entrypoint 2023-12-03 14:31:24 +01:00
README.md Add image location 2023-12-03 13:00:41 +01:00

Pretix Customized for CCCHH

The image adds an entrypoint script that creates /etc/pretix/pretix.cfg from environment variables at startup. The file is only created if it doesn't exist or is empty; this means that you can still mount your own config file into the container as with the original image.

The script will fail and point out if required variables are not set.

The image is available at gitlab-cr.hamburg.ccc.de/ccchh/ccchh-pretix/ccchh-pretix:23.10.0.

Configuration

The config file is created from a template, with environment variables substituted.

[pretix]
instance_name=${PRETIX_INSTANCE_NAME}
url=${PRETIX_URL}
currency=${PRETIX_CURRENCY:-EUR}
datadir=${PRETIX_DATADIR:-/data}
trust_x_forwarded_for=${PRETIX_TRUST_X_FORWARDED_FOR:-on}
trust_x_forwarded_proto=${PRETIX_TRUST_X_FORWARDED_PROTO:-on}

[database]
backend=${DATABASE_BACKEND}
name=${DATABASE_NAME}
user=${DATABASE_USER}
password=${DATABASE_PASSWORD}
host=${DATABASE_HOST}

[mail]
from=${MAIL_FROM}
host=${MAIL_HOST}

[redis]
location=${REDIS_LOCATION}
sessions=${REDIS_SESSION:-true}

[celery]
backend=${CELERY_BACKEND}
broker=${CELERY_BROKER}
EOF

Updating the image

You will need to look up the latest tag at https://hub.docker.com/r/pretix/standalone/tags and change it in both the Dockerfile`` and in ``.gitlab-ci.yml.

Testing the build

docker build -t ccchh-pretix:latest .
docker run -it --rm --name pretix -e PRETIX_INSTANCE_NAME=foo -e PRETIX_URL=http://localhost -e DATABASE_BACKEND=postgresql -e DATABASE_NAME=postgres -e DATABASE_USER=postgres -e DATABASE_PASSWORD=geheim -e DATABASE_HOST=postgres -e MAIL_FROM=foo@example.com -e MAIL_HOST=mail -e REDIS_LOCATION=redis://redis/0 -e CELERY_BACKEND=redis://redis/0 -e CELERY_BROKER=redis://redis/1 ccchh-pretix
docker run -it --rm --name pretix -e PRETIX_INSTANCE_NAME=foo -e PRETIX_URL=http://localhost -e DATABASE_BACKEND=postgresql -e DATABASE_NAME=postgres -e DATABASE_USER=postgres -e DATABASE_PASSWORD=geheim -e DATABASE_HOST=postgres -e MAIL_FROM=foo@example.com -e MAIL_HOST=mail -e REDIS_LOCATION=redis://redis/0 -e CELERY_BACKEND=redis://redis/0 -e CELERY_BROKER=redis://redis/1 gitlab-cr.hamburg.ccc.de/ccchh/ccchh-pretix/ccchh-pretix:23.10.0