Repository navigation
Expand file tree
/
Copy path.env.prod.example
More file actions
72 lines (60 loc) · 3.59 KB
/
Copy path.env.prod.example
File metadata and controls
72 lines (60 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Production environment for deploy/compose.prod.yml.
#
# Never commit the real file. On the VPS run `make prod-init` (scripts/init-prod-env.sh): it copies this file to
# deploy/.env.prod, generates POSTGRES_PASSWORD, derives APP_IMAGE and COMPOSE_PROJECT_NAME from `git remote`, and
# sets mode 600. Then fill the REQUIRED block below and run `make prod-up`.
# ============================================================== REQUIRED (compose refuses to start without them)
# Public hostname. Caddy requests a Let's Encrypt certificate for it, so its A record must already point at this VPS.
DOMAIN=
# Let's Encrypt account e-mail: certificate expiry warnings go here.
ACME_EMAIL=
# Generated by `make prod-init` (openssl rand -hex 24). Never reuse the local app/app defaults on a public host.
POSTGRES_PASSWORD=
# ============================================================== FILLED BY `make prod-init`
# Image Watchtower follows. GHCR requires lowercase; derived from the git remote.
APP_IMAGE=ghcr.io/owner/repo
# Compose project name (volume and network prefix). Keeps two apps on one VPS from sharing a `db` volume.
COMPOSE_PROJECT_NAME=app
# ============================================================== OBSERVABILITY (optional)
# Profiles: `backup` (off-host database backups, see BACKUPS below) and `observability` (Alloy pushes metrics to
# Grafana Cloud). Comma-separated, e.g. COMPOSE_PROFILES=backup,observability.
#COMPOSE_PROFILES=backup,observability
GRAFANA_CLOUD_PROM_URL=
GRAFANA_CLOUD_PROM_USER=
GRAFANA_CLOUD_PROM_TOKEN=
# ============================================================== TUNING (defaults are fine)
# `latest` follows every release. For a rollback: `make prod-rollback TAG=1.4.1`.
APP_IMAGE_TAG=latest
# Two replicas + Caddy's dynamic upstreams = zero-downtime rolling restarts on one VPS.
APP_REPLICAS=2
# Per-replica container memory ceiling; the JVM takes 75% of it (JAVA_TOOL_OPTIONS in the Dockerfile).
APP_MEM_LIMIT=512m
# Hikari pool per replica. replicas × pool must stay below Postgres max_connections (50).
DB_POOL_SIZE=5
# Label attached to every metric; the dashboard's env selector reads it.
APP_ENV=prod
POSTGRES_DB=app
POSTGRES_USER=app
# Postgres is bound to 127.0.0.1 on the VPS only; reach it through `make vps-psql` (SSH tunnel), never publicly.
POSTGRES_HOST_PORT=5432
# Seconds between registry checks for a new image.
WATCHTOWER_POLL_INTERVAL=60
# Only when the GHCR package is private: the config.json written by `docker login ghcr.io` (the file, not its dir),
# e.g. /home/deploy/.docker/config.json. Leave empty for a public package.
DOCKER_CONFIG_FILE=
# ============================================================== BACKUPS (optional, strongly recommended)
# pg_dump every BACKUP_CRON, uploaded with rclone; nothing is kept on this disk. Needs `backup` in COMPOSE_PROFILES
# and deploy/backup/rclone/rclone.conf (docs/deployment.md §6). Without the profile there are NO backups.
# rclone remote and folder, e.g. gdrive:myservice or storagebox:backups/myservice.
RCLONE_REMOTE=
# Directory holding rclone.conf on this host (gitignored), relative to deploy/. A directory, not the file: rclone
# saves refreshed tokens by rename, which fails on a single-file mount.
RCLONE_CONFIG_DIR=./backup/rclone
# busybox cron schedule and the time zone it is read in.
BACKUP_CRON="0 */6 * * *"
BACKUP_TZ=UTC
# Dumps and pre-restore safety dumps older than this many days are pruned after a successful run.
BACKUP_RETENTION_DAYS=30
# `make prod-backup-status` fails beyond this age. The BackupStale alert's 12 h threshold lives in
# deploy/grafana/alerting/rules.json: change both together.
BACKUP_MAX_AGE_HOURS=12