scripts/links/docker/caddy.sh

33 lines
579 B
Bash
Executable File

#!/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 \
--privileged \
--volume $HOME/scripts-private/links/Caddyfile:/etc/caddy/Caddyfile:ro \
--volume /subway/caddy/data:/data:rw \
--publish $(tailscale ip -4):443:443 \
--network pew-net \
customcaddy:latest
}
down () {
docker stop caddy || true
docker rm caddy || true
}
logs () {
docker logs --follow caddy
}
$@