-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
63 lines (58 loc) · 1.61 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
version: "3"
services:
prometheus:
image: prom/prometheus:0.18.0
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
command:
- "-config.file=/etc/prometheus/prometheus.yml"
ports:
- "9090:9090"
grafana:
image: grafana/grafana:5.4.3
environment:
- GF_SECURITY_ADMIN_PASSWORD=pass
# Custom URL for grafana server
# - GF_SERVER_ROOT_URL=https://hskang9.grafana.net
# Plugins to add
# - GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource
depends_on:
- prometheus
ports:
- "9000:9000"
- "3000:3000"
db:
image: "postgres:9"
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data/pgdata
environment:
POSTGRES_PASSWORD: supersecretpassword
PGDATA: /var/lib/postgresql/data/pgdata
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
backend:
build: ./backend
ports:
- "5001:5001"
volumes:
- ./backend:/usr/src/app
links:
- db
# diesel infer_schema macro gives warnings with this flag.
environment:
- CARGO_INCREMENTAL=1
- DATABASE_URL=postgres://postgres:supersecretpassword@db/rustydb
command: bash -c "bash ./wait-for-it.sh db:5432 -q -- diesel setup && diesel migration run && cargo watch -x run"
healthcheck:
test: ["CMD-SHELL", "curl -sS http://0.0.0.0:5001 || exit 1"]
interval: 1m30s
timeout: 10s
retries: 3
# cargo will try to redownload packages @ docker-compose up so store them here.
volumes:
pgdata: {}