Make the deploy panel-friendly: zero-config compose, env vars with defaults

- compose.yaml runs only the app by default; Caddy moved to the
  'standalone' profile (the panel brings its own Caddy and routes).
- No env_file: every setting is ${VAR:-default} in compose.yaml, so it
  can be set from the panel's Environment tab (or .env standalone).
- VAPID keys are generated on first start and kept in the data volume;
  the push subject defaults to https://<site domain>. gen-vapid.ts removed.
- PUSH_DISABLED=1 turns push off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
This commit is contained in:
agent 2026-10-09 22:24:22 +00:00
parent 1382e53359
commit 04d952872d
11 changed files with 191 additions and 152 deletions

View file

@ -1,5 +1,12 @@
# podman compose up -d --build (run from the repo root; reads ./.env)
# See deploy/README.md for the full deploy steps.
# OweMe. Works as-is with zero configuration; every setting below can be
# overridden with an environment variable (in the panel's Environment tab,
# or in a .env file next to this file).
#
# With the panel: point the app's domain at service `app`, port 8080.
# The panel's Caddy provides HTTPS.
# Standalone (no panel): set DOMAIN and run
# podman compose --profile standalone up -d --build
# which adds a Caddy container with automatic HTTPS. See deploy/README.md.
name: oweme
services:
@ -9,9 +16,25 @@ services:
dockerfile: deploy/Containerfile
image: localhost/oweme:latest
restart: unless-stopped
env_file: .env
environment:
# fixed inside the container; everything else comes from .env
# Max size of one uploaded (encrypted) photo, in bytes. Default 2 MB.
MAX_PHOTO_BYTES: ${MAX_PHOTO_BYTES:-2097152}
# Max size of one encrypted event, in bytes. Default 64 KB.
MAX_EVENT_BYTES: ${MAX_EVENT_BYTES:-65536}
# Storage cap per group (events + photos), in bytes. Default 200 MB.
MAX_GROUP_BYTES: ${MAX_GROUP_BYTES:-209715200}
# New groups per client IP per hour.
GROUP_CREATE_PER_HOUR: ${GROUP_CREATE_PER_HOUR:-10}
# Contact sent to push services, e.g. mailto:you@example.com.
# Empty = https://<the site's domain>.
VAPID_SUBJECT: ${VAPID_SUBJECT:-}
# Push keys. Empty = generated on first start and kept in the data
# volume (recommended). Set both only to pin specific keys.
VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY:-}
VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY:-}
# 1 = turn push notifications off.
PUSH_DISABLED: ${PUSH_DISABLED:-0}
# Fixed for the container; no need to change these.
HOST: 0.0.0.0
PORT: "8080"
DATA_DIR: /data
@ -23,18 +46,21 @@ services:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/api/health"]
interval: 30s
timeout: 5s
# no published ports: only Caddy can reach the app
# No ports: the panel publishes 8080 for its routes; standalone, only
# Caddy reaches the app.
caddy:
profiles: [standalone]
image: docker.io/library/caddy:2.10.2-alpine
restart: unless-stopped
depends_on:
- app
environment:
DOMAIN: ${DOMAIN:?set DOMAIN in .env}
# Public hostname for standalone HTTPS (needs a DNS record).
DOMAIN: ${DOMAIN:-localhost}
ports:
# BIND_ADDR defaults to all interfaces (a public VPS). Rootless Podman
# can't bind ports below 1024 by default; see README "Ports".
# Rootless Podman can't bind ports below 1024 by default; see
# deploy/README.md "Ports".
- "${BIND_ADDR:-0.0.0.0}:${HTTP_PORT:-80}:80"
- "${BIND_ADDR:-0.0.0.0}:${HTTPS_PORT:-443}:443"
- "${BIND_ADDR:-0.0.0.0}:${HTTPS_PORT:-443}:443/udp"