-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcompose.yml
More file actions
51 lines (47 loc) · 1.26 KB
/
compose.yml
File metadata and controls
51 lines (47 loc) · 1.26 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
name: shm
services:
app:
image: ghcr.io/btouchard/shm:latest
container_name: shm-app
depends_on:
db:
condition: service_healthy
environment:
SHM_DB_DSN: "postgres://user:password@db:5432/metrics?sslmode=disable"
PORT: "8080"
ports:
- "8080:8080"
db:
image: postgres:15-alpine
container_name: shm-db
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: metrics
ports:
- "5432:5432"
labels:
- docker-volume-backup.stop-during-backup=true
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d metrics"]
interval: 5s
timeout: 5s
retries: 5
backup:
image: offen/docker-volume-backup:v2.46.1
restart: always
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- postgres_data:/backup/shm-backup:ro
- ./backup:/archive # OR STORE ON S3
environment:
BACKUP_CRON_EXPRESSION: "@daily"
BACKUP_FILENAME: "shm-%Y-%m-%dT%H-%M-%S.{{ .Extension }}"
BACKUP_PRUNING_PREFIX: "shm-"
BACKUP_RETENTION_DAYS: 7
volumes:
postgres_data: