-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
38 lines (38 loc) · 1.17 KB
/
compose.yml
File metadata and controls
38 lines (38 loc) · 1.17 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
services:
postgres:
image: postgres
restart: always
volumes:
- ./data:/var/lib/postgresql/data
env_file:
- path: .env
required: true
ports:
- "5432:5432"
postgres_backup:
# Use the published image from GitHub Container Registry
image: ghcr.io/servicestack/backup-postgres:latest
# For local development, uncomment the build section below and comment out the image line:
# build:
# context: .
# dockerfile: Dockerfile
depends_on:
- postgres
volumes:
- ./backups:/backups
- /etc/localtime:/etc/localtime:ro
environment:
- POSTGRES_HOST=postgres
- BACKUP_INTERVAL=86400 # 24 hours
- RETENTION_DAYS=7 # Keep local backups for 7 days
- S3_RETENTION_DAYS=30 # Keep S3 backups for 30 days (optional)
# S3 configuration (set these in .env file)
# - S3_BUCKET=your-backup-bucket
# - S3_PREFIX=db-backups
# AWS credentials should be set in .env file:
# - AWS_ACCESS_KEY_ID=your-access-key
# - AWS_SECRET_ACCESS_KEY=your-secret-key
# - AWS_DEFAULT_REGION=us-east-1
env_file:
- path: .env
required: true