forked from sergiitk/pagerbeauty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
158 lines (150 loc) · 5.52 KB
/
docker-compose.yaml
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
version: '3'
services:
pagerbeauty-dev:
build:
context: .
dockerfile: ./Dockerfile-dev
command: ['yarn', 'run', 'app:watch']
environment:
# Use PagerDuty API Mock server for development
PAGERBEAUTY_PD_API_URL: ${PAGERBEAUTY_PD_API_URL:-http://mock-pagerduty-api:8090}
# API key is required, but Mock PD API will ignore it
PAGERBEAUTY_PD_API_KEY: ${PAGERBEAUTY_PD_API_KEY:-v2_api_key}
# Mock PD API provides three predefined schedules
# UNKNOWN is to ensure incorrect schedules don't prevent valid from loading
PAGERBEAUTY_PD_SCHEDULES: >-
${PAGERBEAUTY_PD_SCHEDULES:-UNKNOWN,P538IZH,PJ1P5JQ,P2RFGIP}
# Faster refresh for dev server
# Schedules and oncalls every 15 seconds
PAGERBEAUTY_REFRESH_RATE_MINUTES: ${PAGERBEAUTY_REFRESH_RATE_MINUTES:-0.25}
# Incidents every 12 seconds
PAGERBEAUTY_INCIDENTS_REFRESH_RATE_MINUTES: >-
${PAGERBEAUTY_INCIDENTS_REFRESH_RATE_MINUTES:-0.20}
ports:
- ${PAGERBEAUTY_HTTP_PORT:-8080}:${PAGERBEAUTY_HTTP_PORT:-8080}
volumes:
- ./src/:/usr/src/app/src/:ro
- ./assets/:/usr/src/app/assets/:ro
- ./package.json:/usr/src/app/package.json:ro
- ./yarn.lock:/usr/src/app/yarn.lock:ro
- node-modules-shared:/usr/src/app/node_modules:nocopy
depends_on:
- yarn
- mock-pagerduty-api
- pagerbeauty-dev-assets
pagerbeauty-dev-with-auth:
build:
context: .
dockerfile: ./Dockerfile-dev
command: ['yarn', 'run', 'app:watch']
environment:
# Use PagerDuty API Mock server for development
PAGERBEAUTY_PD_API_URL: ${PAGERBEAUTY_PD_API_URL:-http://mock-pagerduty-api:8090}
# API key is required, but Mock PD API will ignore it
PAGERBEAUTY_PD_API_KEY: ${PAGERBEAUTY_PD_API_KEY:-v2_api_key}
# Test on two schedules
PAGERBEAUTY_PD_SCHEDULES: ${PAGERBEAUTY_PD_SCHEDULES:-P538IZH,PJ1P5JQ}
# Run on different port than no auth app
PAGERBEAUTY_HTTP_PORT: ${PAGERBEAUTY_WITH_AUTH_HTTP_PORT:-8081}
# Basic HTTP authentication
PAGERBEAUTY_HTTP_USER: ${PAGERBEAUTY_HTTP_USER:-basic_username}
PAGERBEAUTY_HTTP_PASSWORD: ${PAGERBEAUTY_HTTP_PASSWORD:-basic_password}
PAGERBEAUTY_HTTP_ACCESS_TOKEN: >-
${PAGERBEAUTY_HTTP_ACCESS_TOKEN:-803651A9-E3B7-4153-9566-6E54F5F0CEAB}
ports:
- ${PAGERBEAUTY_WITH_AUTH_HTTP_PORT:-8081}:${PAGERBEAUTY_WITH_AUTH_HTTP_PORT:-8081}
volumes:
- ./src/:/usr/src/app/src/:ro
- ./assets/:/usr/src/app/assets/:ro
- ./package.json:/usr/src/app/package.json:ro
- ./yarn.lock:/usr/src/app/yarn.lock:ro
- node-modules-shared:/usr/src/app/node_modules:nocopy
depends_on:
- yarn
- mock-pagerduty-api
- pagerbeauty-dev-assets
pagerbeauty-dev-assets:
build:
context: .
dockerfile: ./Dockerfile-dev
command: ['yarn', 'run', 'build:watch']
volumes:
- ./src/:/usr/src/app/src/:ro
- ./assets/:/usr/src/app/assets/:rw
- ./package.json:/usr/src/app/package.json:ro
- ./yarn.lock:/usr/src/app/yarn.lock:ro
- ./webpack.common.js:/usr/src/app/webpack.common.js:ro
- ./webpack.dev.js:/usr/src/app/webpack.dev.js:ro
- node-modules-shared:/usr/src/app/node_modules:nocopy
depends_on:
- yarn
mock-pagerduty-api:
build:
context: .
dockerfile: ./Dockerfile-dev
command:
- yarn
- run
- mock:pagerduty_api
- '-p'
- ${PAGERBEAUTY_PD_API_MOCK_PORT:-8090}
ports:
- ${PAGERBEAUTY_PD_API_MOCK_PORT:-8090}:${PAGERBEAUTY_PD_API_MOCK_PORT:-8090}
volumes:
- ./test/mocks/:/usr/src/app/test/mocks/
- ./package.json:/usr/src/app/package.json:ro
- ./yarn.lock:/usr/src/app/yarn.lock:ro
- node-modules-shared:/usr/src/app/node_modules:nocopy
depends_on:
- yarn
test-acceptance:
build:
context: .
dockerfile: ./Dockerfile-test-acceptance
environment:
PAGERBEAUTY_URL: http://pagerbeauty-dev:${PAGERBEAUTY_HTTP_PORT:-8080}
PAGERBEAUTY_URL_WITH_AUTH: >-
http://pagerbeauty-dev-with-auth:${PAGERBEAUTY_WITH_AUTH_HTTP_PORT:-8081}
# Basic HTTP authentication
PAGERBEAUTY_HTTP_USER: ${PAGERBEAUTY_HTTP_USER:-basic_username}
PAGERBEAUTY_HTTP_PASSWORD: ${PAGERBEAUTY_HTTP_PASSWORD:-basic_password}
PAGERBEAUTY_HTTP_ACCESS_TOKEN: >-
${PAGERBEAUTY_HTTP_ACCESS_TOKEN:-803651A9-E3B7-4153-9566-6E54F5F0CEAB}
volumes:
- ./src/:/usr/src/app/src/:ro
- ./test/:/usr/src/app/test/:ro
- ./package.json:/usr/src/app/package.json:ro
- ./yarn.lock:/usr/src/app/yarn.lock:ro
- node-modules-shared:/usr/src/app/node_modules:nocopy
depends_on:
- yarn
- pagerbeauty-dev
- pagerbeauty-dev-with-auth
yarn:
build:
context: .
dockerfile: ./Dockerfile-dev
entrypoint: ['yarn']
command: ['help']
volumes:
- ./src/:/usr/src/app/src/:ro
- ./test/:/usr/src/app/test/:ro
- ./package.json:/usr/src/app/package.json:rw
- ./yarn.lock:/usr/src/app/yarn.lock:rw
- node-modules-shared:/usr/src/app/node_modules
# Grafana
# admin/admin
grafana:
image: grafana/grafana
ports:
- ${PAGERBEAUTY_GRAFANA_PORT:-3000}:${PAGERBEAUTY_PD_API_MOCK_PORT:-3000}
environment:
GF_INSTALL_PLUGINS: ryantxu-ajax-panel
volumes:
- ./test/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ./test/grafana/dashboards:/var/lib/grafana/dashboards
depends_on:
- pagerbeauty-dev
# Use shared node_modules
volumes:
node-modules-shared: