#!/bin/bash set -e up () { # Ensure iptables rules exist # https://askubuntu.com/questions/1052919/iptables-reload-restart-on-ubuntu/1072948#1072948 docker network create --ipv6 --subnet "fd01::/80" pew-net || true # main caddy container docker run \ --detach \ --name caddy \ --restart unless-stopped \ --privileged \ --volume /bigdata/k8s-config/caddy/Caddyfile:/etc/caddy/Caddyfile:ro \ --volume /bigdata/k8s-config/caddy/data:/data:rw \ --volume /bigdata/gis/bigcavemaps.com:/www/bigcavemaps.com:ro \ --volume /bigdata/files:/www/seaturtle.pw_files:ro \ --publish 80:80 \ --publish 443:443 \ --publish 443:443/udp \ --network pew-net \ docker.io/caddy:2.6.2 } down () { docker stop caddy || true docker rm caddy || true } logs () { docker logs --follow caddy } $@