add caddy (podman version)

This commit is contained in:
Michi 2025-12-20 12:52:31 +01:00
parent 0a7fd56fd2
commit e7c003ae61
2 changed files with 33 additions and 0 deletions

3
caddy/Caddyfile Normal file
View file

@ -0,0 +1,3 @@
example.com {
reverse_proxy container-name:port
}

30
caddy/podman.sh Normal file
View file

@ -0,0 +1,30 @@
#!/bin/bash
# Caddy Proxy (Podman script)
# Michi von Ah
# Link: https://github.com/michivonah/docker/tree/main/caddy
# Make script executable: chmod +x podman.sh
# Pod setup
podman network create caddy --ignore
podman pod create --name caddy --replace
# Create directories & files
mkdir -p data
touch Caddyfile
# Caddy
podman run --name caddy-proxy -d \
--replace \
--pod caddy \
-p 80:80 \
-p 443:443 \
-v ./Caddyfile:/etc/caddy/Caddyfile:z,ro \
-v ./data:/data:z,U \
--restart always \
--network caddy \
-u ${UID:-1000}:${GID:-1000} \
docker.io/caddy
# UID & GID should be set by default on most linux distros, so you don't have to change it here.
# Add another container to the caddy network: --network caddy