#!/bin/bash set -e up () { docker network create pew-net || true # main caddy container docker build -t customcaddy:latest -f Dockerfile.caddy . docker run \ --detach \ --name caddy \ --restart unless-stopped \ --label com.centurylinklabs.watchtower.enable=false \ --privileged \ --volume /mammoth/archive:/www/bigcavemaps.com/files/paul/archive:ro \ --volume /mammoth/wind-files:/www/bigcavemaps.com/files/paul/wind-files:ro \ --volume /mammoth/archive/cavepedia/cavepedia-data/00_files:/www/bigcavemaps.com/files/cavepedia-data/00_files:ro \ --volume /mammoth/archive/vpicc/private/balister-cave:/www/bigcavemaps.com/files/vpicc/private/balister-cave:ro \ --volume /mammoth/archive/vpicc/public:/www/bigcavemaps.com/files/vpicc/public:ro \ --volume /mammoth/archive/websites/wacz:/www/bigcavemaps.com/files/websites:ro \ --volume /mammoth/files/seaturtle.pw:/www/seaturtle.pw/files:ro \ --volume /mammoth/gis/bigcavemaps.com:/www/bigcavemaps.com/index:ro \ --volume /mammoth/gis/source/public:/www/bigcavemaps.com/files/gis/source/public:ro \ --volume /mammoth/merginmaps/projects:/merginmaps-data:ro \ --volume /mammoth/pretalx/data/media:/pretalx/data/media:ro \ --volume /mammoth/pretalx/public/static:/pretalx/public/static:ro \ --volume /mammoth/replayweb.page:/www/files/bigcavemaps.com/replayweb.page:ro \ --volume $HOME/scripts-private/lech/Caddyfile:/etc/caddy/Caddyfile:ro \ --volume /mammoth/caddy/data:/data:rw \ --volume /mammoth/caddy/logs:/logs:rw \ --publish 443:443 \ --publish 443:443/udp \ --publish 6233:6233 \ --publish [$(tailscale ip -4)]:8443:8443 \ --publish [$(tailscale ip -4)]:8443:8443/udp \ --publish [$(tailscale ip -6)]:8443:8443 \ --publish [$(tailscale ip -6)]:8443:8443/udp \ --network pew-net \ customcaddy:latest } down () { docker stop caddy || true docker rm caddy || true } logs () { docker logs --follow caddy } $@