-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.full.yml
More file actions
80 lines (71 loc) · 3.25 KB
/
Copy pathdocker-compose.full.yml
File metadata and controls
80 lines (71 loc) · 3.25 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
73
74
75
76
77
78
79
80
# ─────────────────────────────────────────────────────────────
# Full — every feature, heavily commented as a reference
# Copy what you need; most settings have sensible defaults and can be omitted.
# For files > 50 MB see the large-files-* examples. See examples/README.md.
# ─────────────────────────────────────────────────────────────
services:
postgres:
image: postgres:17
environment:
POSTGRES_DB: mydb
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U myuser"]
interval: 5s
timeout: 3s
retries: 5
restart: unless-stopped
backup:
image: ganiyevuz/backupgram:17
depends_on:
postgres:
condition: service_healthy
environment:
# ── Database connection ──
POSTGRES_HOST: postgres
POSTGRES_DB: "mydb,analytics" # comma-separated for multiple databases
# Auto-discover every database on the server instead of listing them.
# When TRUE, POSTGRES_DB above is ignored (templates + the 'postgres' DB are always skipped).
# POSTGRES_DB_AUTODISCOVER: "TRUE"
# POSTGRES_DB_EXCLUDE: "analytics,scratch" # names to skip from auto-discovery
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_PORT: 5432
POSTGRES_CONNECT_TIMEOUT: 30
# ── Schedule & dump options ──
SCHEDULE: "0 2 * * *" # cron: 2 AM daily (or @daily, @weekly, …)
BACKUP_ON_START: "TRUE" # also back up immediately on container start
POSTGRES_EXTRA_OPTS: "-Z6" # pg_dump flags (here: gzip level 6)
POSTGRES_EXCLUDE_TABLES: "django_session,celery_tasksetmeta"
# ── Retention (per rotation slot) ──
BACKUP_KEEP_DAYS: 7
BACKUP_KEEP_WEEKS: 4
BACKUP_KEEP_MONTHS: 6
BACKUP_KEEP_MINS: 1440 # how long to keep files in last/
# ── Encryption (optional) ──
BACKUP_ENCRYPTION_KEY: "${BACKUP_ENCRYPTION_KEY}" # GPG AES-256; empty = disabled
# ── Disk-space safety ──
BACKUP_MIN_DISK_SPACE: 500 # MB free required before a backup runs
# ── Telegram delivery ──
TELEGRAM_BOT_TOKEN: "${TELEGRAM_BOT_TOKEN}"
TELEGRAM_CHAT_ID: "${TELEGRAM_CHAT_ID}" # comma-separated to fan out to several chats
TELEGRAM_THREAD_ID: "" # supergroup topic id (single-chat only)
TELEGRAM_NOTIFY_ON: "all" # all | failure | success | none
TELEGRAM_UPLOAD_METHOD: "smart" # smart | botapi | mtproto (see large-files examples)
PROJECT_NAME: "My Project" # label shown in captions/alerts
# ── Webhooks (optional) ──
WEBHOOK_URL: ""
WEBHOOK_PRE_BACKUP_URL: ""
WEBHOOK_POST_BACKUP_URL: ""
WEBHOOK_ERROR_URL: ""
# ── Healthcheck ──
HEALTHCHECK_PORT: 8080
volumes:
- backups:/backups
restart: unless-stopped
volumes:
pgdata:
backups: