Repository navigation
Expand file tree
/
Copy path.env.prod.example
More file actions
59 lines (48 loc) · 2.77 KB
/
Copy path.env.prod.example
File metadata and controls
59 lines (48 loc) · 2.77 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
# 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)
# Uncomment to start Alloy, which pushes metrics to Grafana Cloud. Grafana Cloud → your stack → Prometheus →
# "Send metrics": the remote-write URL, the numeric instance id (user) and an access-policy token with metrics:write.
#COMPOSE_PROFILES=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=
# pg_dump destination on the VPS, interval and retention (days). Restore: `make prod-restore FILE=...`.
BACKUP_DIR=./backups
BACKUP_INTERVAL_SECONDS=86400
BACKUP_RETENTION_DAYS=14