-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
114 lines (103 loc) · 2.73 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
version: "3.7"
services:
postgres:
image: postgres:11-alpine
environment:
- POSTGRES_DB:${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASS}
ports:
- "5432:5432" # for debugging db
server:
build: .
image: aragon/protocol-backend
command: npm run start:server:dev
depends_on:
- postgres
- loki
ports:
- "${SERVER_PORT}:${SERVER_PORT}"
- "${SERVER_METRICS_PORT}:${SERVER_METRICS_PORT}" # for debugging metrics
volumes:
- ./packages/server/src:/app/packages/server/src
- ./packages/server/test:/app/packages/server/test
env_file:
- .env
logging: &loki
driver: loki
options:
loki-url: http://localhost:3100/loki/api/v1/push
# required to be compatible with k8s metrics
loki-external-labels: container={{.Name}},app=protocol-backend
services:
build: .
image: aragon/protocol-backend
command: npm run start:services:dev
depends_on:
- server
- loki
volumes:
- ./packages/services/bin:/app/packages/services/bin
- ./packages/services/src:/app/packages/services/src
- ./packages/services/test:/app/packages/services/test
env_file:
- .env
logging: *loki
backoffice:
build: .
image: aragon/protocol-backend
command: npm run start:app
depends_on:
- server
- loki
ports:
- "3000:3000"
- "35729:35729" # port used for hot-reloading
volumes:
- ./packages/app/src:/app/packages/app/src
- ./packages/app/public:/app/packages/app/public
env_file:
- .env
logging: *loki
# for running test commands
test:
build: .
image: aragon/protocol-backend
command: sleep infinity
depends_on:
- postgres
volumes:
# speed up development by mounting some local directories with hot reload
- ./packages/server/src:/app/packages/server/src
- ./packages/server/test:/app/packages/server/test
- ./packages/services/bin:/app/packages/services/bin
- ./packages/services/src:/app/packages/services/src
- ./packages/services/test:/app/packages/services/test
- ./packages/shared/src:/app/packages/shared/src
- ./packages/shared/build:/app/packages/shared/build
env_file:
- .env
## Monitoring containers below
prometheus:
image: prom/prometheus
depends_on:
- server
- services
volumes:
- ./monitoring/prometheus:/etc/prometheus
loki:
image: grafana/loki
ports:
- "3100:3100"
grafana:
image: grafana/grafana
depends_on:
- prometheus
- loki
ports:
- "5000:3000"
environment:
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
volumes:
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning