Move compose.yaml and .env.example to the repo root

Deploy is now `podman compose up -d` from the root. Add .containerignore
so node_modules, local data and .env stay out of the build context, and
mount only .env (not the whole tree) when generating VAPID keys.

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 20:45:28 +00:00
parent 41b3487a5a
commit 1382e53359
9 changed files with 31 additions and 21 deletions

View file

@ -1,23 +0,0 @@
# Copy to deploy/.env and `chmod 600 deploy/.env`. Never commit .env.
# Required: public hostname, with a DNS A/AAAA record pointing at this server.
DOMAIN=oweme.example.com
# Web Push. Generate the keys with:
# podman run --rm --user root -v ./:/out:Z localhost/oweme:latest node server/gen-vapid.ts /out/.env
# (or, with Node 24 installed: node apps/server/src/gen-vapid.ts deploy/.env)
# Leave empty to disable notifications.
VAPID_SUBJECT=mailto:you@example.com
VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=
# Limits (bytes). Defaults shown.
MAX_PHOTO_BYTES=2097152
MAX_EVENT_BYTES=65536
MAX_GROUP_BYTES=209715200
GROUP_CREATE_PER_HOUR=10
# Where Caddy listens. Defaults: all interfaces, ports 80/443.
#BIND_ADDR=0.0.0.0
#HTTP_PORT=80
#HTTPS_PORT=443

View file

@ -12,7 +12,7 @@ web client) and **caddy** (HTTPS and reverse proxy). Only Caddy publishes ports.
## First deploy
```sh
git clone <repo> oweme && cd oweme/deploy
git clone <repo> oweme && cd oweme
cp .env.example .env
chmod 600 .env
@ -20,7 +20,7 @@ $EDITOR .env # set DOMAIN and VAPID_SUBJECT (mailto:)
podman compose build # builds localhost/oweme:latest
# Web Push keys: written into .env, private key never printed.
podman run --rm --user root -v ./:/out:Z localhost/oweme:latest node server/gen-vapid.ts /out/.env
podman run --rm --user root -v ./.env:/out/.env:Z localhost/oweme:latest node server/gen-vapid.ts /out/.env
podman compose up -d
podman compose logs -f # Caddy obtains the certificate on first request
@ -32,12 +32,12 @@ Open `https://$DOMAIN`. `curl https://$DOMAIN/api/health` should say `{"ok":true
```sh
cd oweme && git pull
cd deploy && podman compose up -d --build
podman compose up -d --build
```
Data lives in the `oweme-data` volume and survives rebuilds.
## Configuration (`deploy/.env`)
## Configuration (`.env`)
| Variable | Required | Default | Purpose |
|---|---|---|---|

View file

@ -1,49 +0,0 @@
# podman compose up -d --build (run from this directory; reads ./.env)
# See deploy/README.md for the full deploy steps.
name: oweme
services:
app:
build:
context: ..
dockerfile: deploy/Containerfile
image: localhost/oweme:latest
restart: unless-stopped
env_file: .env
environment:
# fixed inside the container; everything else comes from .env
HOST: 0.0.0.0
PORT: "8080"
DATA_DIR: /data
STATIC_DIR: /app/web
TRUST_PROXY: "1"
volumes:
- oweme-data:/data
healthcheck:
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
caddy:
image: docker.io/library/caddy:2.10.2-alpine
restart: unless-stopped
depends_on:
- app
environment:
DOMAIN: ${DOMAIN:?set DOMAIN in deploy/.env}
ports:
# BIND_ADDR defaults to all interfaces (a public VPS). Rootless Podman
# can't bind ports below 1024 by default; see README "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"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro,Z
- caddy-data:/data
- caddy-config:/config
volumes:
oweme-data:
caddy-data:
caddy-config: