-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.example.yml
More file actions
77 lines (60 loc) · 1.9 KB
/
docker-compose.example.yml
File metadata and controls
77 lines (60 loc) · 1.9 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
version: '3.8'
services:
pg-backup-scheduler:
build: .
image: pg-backup:latest
container_name: pg-backup-scheduler
restart: unless-stopped
# Run in scheduler mode
command: ["-schedule", "-config", "/config/config.yaml"]
# Uncomment for single backup run
# command: ["-config", "/config/config.yaml"]
# Uncomment for restore mode
# command: ["-restore", "-config", "/config/config.yaml"]
volumes:
# Configuration file
- ./config.yaml:/config/config.yaml:ro
# SSH keys (if using key authentication)
- ~/.ssh:/home/pgbackup/.ssh:ro
# Backup storage (optional, for local backups)
- ./backups:/backup
# Logs (optional)
- ./logs:/logs
# Known hosts file (optional)
# - ~/.ssh/known_hosts:/home/pgbackup/.ssh/known_hosts:ro
environment:
# Override log settings
- LOG_LEVEL=info
- JSON_LOGS=false
# Timezone (important for scheduling)
- TZ=UTC
# Optional: Override config values with environment variables
# - PG_BACKUP_SSH_HOST=prod-server.example.com
# - PG_BACKUP_SSH_PORT=22
# - PG_BACKUP_SSH_USERNAME=backup-user
# - PG_BACKUP_POSTGRES_DATABASE=production_db
# - PG_BACKUP_S3_ENDPOINT=https://s3.amazonaws.com
# - PG_BACKUP_S3_BUCKET=my-backup-bucket
# Network mode - use host network if connecting to local PostgreSQL
# network_mode: host
# Or use bridge network (default)
networks:
- pg-backup-net
# Resource limits (optional)
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
networks:
pg-backup-net:
driver: bridge
# Example volume definitions for persistent storage
volumes:
backup-data:
driver: local
log-data:
driver: local