-
Notifications
You must be signed in to change notification settings - Fork 16
/
docker-compose.yml
125 lines (116 loc) · 3.52 KB
/
docker-compose.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
version: "2.2"
services:
#exporter:
# build: ./
# image: camptocamp/wal-g-prometheus-exporter:latest
# environment:
# AWS_ACCESS_KEY_ID: AKIAACCESSKEY
# AWS_SECRET_ACCESS_KEY: SECRETSECRET
# WALE_S3_PREFIX: s3://walg/backup
# AWS_ENDPOINT: http://minio:9000
# AWS_S3_FORCE_PATH_STYLE: "true"
# #- AWS_REGION=some-region
# command: ["/tmp/archive_status"]
postgres:
image: camptocamp/postgres:12
command: -c 'synchronous_commit=off' -c 'fsync=off' -c 'archive_mode=on' -c 'archive_command=/bin/wal-g wal-push %p'
cpu_count: 1
environment:
POSTGRES_PASSWORD: pgpass
POSTGRES_USER: postgres
POSTGRES_INITDB_WALDIR: /mnt/wal
AWS_ACCESS_KEY_ID: AKIAACCESSKEY
AWS_SECRET_ACCESS_KEY: SECRETSECRET
WALE_S3_PREFIX: s3://walg/backup
AWS_ENDPOINT: http://minio:9000
AWS_S3_FORCE_PATH_STYLE: "true"
ports:
- "5432:5432"
volumes:
- ./wal:/mnt/wal
- pgdata:/var/lib/postgresql/data
- ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- ./docker/full-backup.sh:/usr/local/bin/full-backup.sh
full-backup:
image: camptocamp/postgres:12
cpu_count: 1
entrypoint: ""
command: /usr/local/bin/full-backup.sh
environment:
PGUSER: postgres
PGPASSWORD: pgpass
PGHOST: postgres
AWS_ACCESS_KEY_ID: AKIAACCESSKEY
AWS_SECRET_ACCESS_KEY: SECRETSECRET
WALE_S3_PREFIX: s3://walg/backup
AWS_ENDPOINT: http://minio:9000
AWS_S3_FORCE_PATH_STYLE: "true"
volumes:
- pgdata:/var/lib/postgresql/data
- ./docker/full-backup.sh:/usr/local/bin/full-backup.sh
fix-wal-permissions:
image: camptocamp/postgres:12
entrypoint: /usr/local/bin/fix-wal-permissions.sh
volumes:
- ./wal:/mnt/wal
- ./docker/fix-wal-permissions.sh:/usr/local/bin/fix-wal-permissions.sh
traffic:
image: camptocamp/postgres:12
entrypoint: ""
command: /usr/local/bin/traffic.sh
environment:
PGUSER: postgres
PGPASSWORD: pgpass
PGHOST: postgres
volumes:
- ./docker/traffic.sh:/usr/local/bin/traffic.sh
minio:
# Limit bandwidth with: tc qdisc add dev br-577ead7e585d root tbf rate 1000kbps latency 50ms burst 2500
image: minio/minio
#entrypoint: ""
#command: sh
#tty: true
#stdin_open: true
command: server /data
volumes:
- minio:/data
ports:
- "9000:9000"
environment:
MINIO_ACCESS_KEY: AKIAACCESSKEY
MINIO_SECRET_KEY: SECRETSECRET
create-bucket:
image: amazon/aws-cli
entrypoint: /create-bucket-entrypoint.sh
stop_signal: SIGKILL
volumes:
- ./docker/create-bucket-entrypoint.sh:/create-bucket-entrypoint.sh
environment:
MINIO_URL: http://minio:9000
BUCKET: walg
AWS_ACCESS_KEY_ID: AKIAACCESSKEY
AWS_SECRET_ACCESS_KEY: SECRETSECRET
# Observability
prometheus:
image: prom/prometheus
cpu_count: 1
volumes:
- ./docker/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus:/prometheus
ports:
- "9090:9090"
grafana:
image: grafana/grafana:6.7.3
cpu_count: 1
volumes:
- grafana-data:/var/lib/grafana
- ./docker/grafana/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
- ./docker/grafana/dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml
- ./docker/grafana/dashboard.json:/var/lib/grafana/dashboards/dashboard.json
ports:
- "3000:3000"
volumes:
pgdata:
minio:
prometheus:
grafana-data: