scripts/lech/docker/pretix.sh

50 lines
1.0 KiB
Bash
Raw Permalink Normal View History

2024-09-02 16:53:27 -04:00
#!/bin/bash
set -e
up () {
docker run \
--detach \
--name pretix-db \
--restart unless-stopped \
--env POSTGRES_DB=pretix_db \
--env POSTGRES_PASSWORD=pretix_pw \
--env POSTGRES_USER=pretix_user \
--volume /mammoth/pretix/postgres:/var/lib/postgresql/data:rw \
--network pew-net \
postgres:12
docker run \
--detach \
--name pretix-redis \
--restart unless-stopped \
--volume /mammoth/pretix/redis:/data:rw \
--network pew-net \
redis:7
echo 'Waiting 5 seconds for postgresql to start up...'
sleep 5
# Exposed on port 80 in pew-net
docker run \
--detach \
--name pretix \
--restart unless-stopped \
--volume /mammoth/pretix/pretix-config:/etc/pretix:rw \
--volume /mammoth/pretix/pretix-data:/data:rw \
--network pew-net \
pretix/standalone:stable all
}
down () {
docker stop pretix || true
docker rm pretix || true
docker stop pretix-db || true
docker rm pretix-db || true
docker stop pretix-redis || true
docker rm pretix-redis || true
}
$@