scripts/fogcutter/docker/caddy.sh

37 lines
844 B
Bash
Raw Normal View History

2022-09-25 15:24:41 -04:00
#!/bin/bash
set -e
up () {
2022-12-23 19:30:06 -05:00
# 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
2022-09-25 15:24:41 -04:00
# main caddy container
docker run \
--detach \
--name caddy \
--restart unless-stopped \
2022-10-03 10:51:42 -04:00
--privileged \
2022-09-25 15:24:41 -04:00
--volume /bigdata/k8s-config/caddy/Caddyfile:/etc/caddy/Caddyfile:ro \
--volume /bigdata/k8s-config/caddy/data:/data:rw \
2022-10-03 10:51:42 -04:00
--volume /bigdata/gis/bigcavemaps.com:/www/bigcavemaps.com:ro \
--volume /bigdata/files:/www/seaturtle.pw_files:ro \
2022-09-25 15:24:41 -04:00
--publish 80:80 \
--publish 443:443 \
2022-10-03 10:51:42 -04:00
--publish 443:443/udp \
2022-09-25 15:24:41 -04:00
--network pew-net \
2022-12-21 14:54:16 -05:00
docker.io/caddy:2.6.2
2022-09-25 15:24:41 -04:00
}
down () {
docker stop caddy || true
docker rm caddy || true
}
logs () {
docker logs --follow caddy
}
$@