-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.yml
99 lines (99 loc) · 2.55 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
version: '2'
services:
api:
image: mendersoftware/mantra-api:master
build:
context: ./backend
dockerfile: Dockerfile
container_name: mantra-api
ports:
- "7374:7374"
restart: unless-stopped
depends_on:
db:
condition: service_healthy
db:
image: bitnami/postgresql:12.2.0
container_name: mantra-db
ports:
# note: exposing port 5432 here causes issues in travis builds
- "5432"
environment:
POSTGRES_PASSWORD: password
POSTGRES_DB: mantra-db
healthcheck:
test: pg_isready --user=postgres --dbname=mantra-db || exit 1
interval: 10s
timeout: 5s
retries: 10
postgraphile:
image: graphile/postgraphile
container_name: postgraphile
depends_on:
db:
condition: service_healthy
ports:
- "5433:5433"
command:
[
'--connection',
'postgres://postgres:password@db:5432/mantra-db',
'--port',
'5433',
'--schema',
'public',
'--enhance-graphiql'
]
ui:
image: mendersoftware/mantra-ui:master
build:
context: ./ui
dockerfile: Dockerfile
container_name: mantra-ui
environment:
- AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- GITLAB_TOKEN=$GITLAB_TOKEN
ports:
- "8080:80"
depends_on:
- api
gateway:
image: nginx:stable-alpine
container_name: mantra-gateway
entrypoint: >
/bin/sh -c 'echo " events {} http {
server {
location / {
proxy_max_temp_file_size 128m;
proxy_buffers 16 16k;
proxy_buffer_size 16k;
proxy_pass http://ui:80;
}
location /_next/webpack-hmr {
proxy_pass http://ui:80/_next/webpack-hmr;
proxy_http_version 1.1;
proxy_set_header Upgrade \$$http_upgrade;
proxy_set_header Connection "upgrade";
}
location ~* /api/(.*) {
proxy_max_temp_file_size 128m;
proxy_buffers 16 16k;
proxy_buffer_size 16k;
rewrite ^/api(.*)$$ \$$1 break;
proxy_pass http://api:7374;
}
location ~* /graph(i?)ql(.*) {
proxy_max_temp_file_size 128m;
proxy_buffers 16 16k;
proxy_buffer_size 16k;
proxy_pass http://postgraphile:5433;
}
}
}" > /etc/nginx/nginx.conf && nginx -g "daemon off;" '
ports:
# The HTTP port
- "80:80"
depends_on:
- ui
- api