Podman Deployment #
This setup uses a Podman pod with two containers:
waffle pod
├── waffle app container, private 127.0.0.1:8080
└── Caddy container, public :80 or :443
This keeps the app and Caddy separate while still making them easy to run together.
Local production-like test #
Install Podman first. On macOS this usually also requires starting the Podman machine.
brew install podman
podman machine init
podman machine start
Then from the repo root:
./deploy/podman-local.sh
Default URL:
http://127.0.0.1:8081
This flow was tested locally with Podman 5.8.2 on macOS.
For iPhone LAN testing, use your Mac's LAN IP:
http://<mac-lan-ip>:8081
Data is stored outside the containers by default:
.waffle-data/
waffle.db
videos/
Useful commands #
podman pod ps
podman ps --pod
podman logs waffle-local-app
podman logs waffle-local-caddy
podman pod rm -f waffle-local
Production notes #
Use deploy/Caddyfile.production.example as the starting point and replace:
waffle.example.com
with the real subdomain.
Recommended production env for the app container:
WAFFLE_ADDR=127.0.0.1:8080
WAFFLE_DB=/data/waffle.db
WAFFLE_VIDEOS_DIR=/data/videos
WAFFLE_PUBLIC_URL=https://waffle.example.com
WAFFLE_SECURE_COOKIES=true
WAFFLE_SESSION_MAX_AGE=2592000
Persist /data on the host and back it up regularly.
Why a pod instead of one container? #
A pod keeps Caddy and the Go app as separate processes/containers, but they share a network namespace. That means Caddy can reverse-proxy to the app at 127.0.0.1:8080, while only Caddy needs public ports.