-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathdocker-compose.apollo.2.yml
83 lines (79 loc) · 2.71 KB
/
docker-compose.apollo.2.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
version: "3.9"
services:
apollo:
image: hrbolek/apollo_federation
# image: apollofederation:latest
environment:
# promenne, ktere lze cist v kontejneru
- PORT=3000
- |
SERVICES=
[
{"name": "ug", "url": "http://gql_ug:8000/gql"},
{"name": "forms", "url": "http://gql_forms:8000/gql"}
]
healthcheck:
# definice, umoznujici provest test, zda je kontejner v poradku (vsimnete si portu a srovnejte s portem v environment)
interval: 60s
retries: 3
start_period: 60s
timeout: 10s
restart: on-failure:3 # nedojde k restartu pokud je kontejner "unhealthy", maximalne 3 pokusy
# ports: #v deploymentu by nebylo zadne mapovani portu
# vnejsi port : port, kde sluzbu poskytuje kontejner
# - 33000:3000
depends_on:
- gql_ug
- gql_forms
gql_ug:
image: hrbolek/gql_ug
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=example
- POSTGRES_HOST=host.docker.internal:5432
- POSTGRES_DB=data
- JWTPUBLICKEYURL=http://frontend:8000/oauth/publickey
- JWTRESOLVEUSERPATHURL=http://frontend:8000/oauth/userinfo
- DEMO=True
healthcheck:
# definice, umoznujici provest test, zda je kontejner v poradku
test: "curl -f -H 'Content-Type: application/json' -X POST -d '{\"query\":\"query{__schema{types{name}}}\"}' http://localhost:8000/gql || exit 1"
interval: 60s
retries: 3
start_period: 60s
timeout: 10s
restart: on-failure:3 # nedojde k restartu pokud je kontejner "unhealthy", maximalne 3 pokusy
ports:
- 33012:8000
gql_forms:
image: hrbolek/gql_forms
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=example
- POSTGRES_HOST=host.docker.internal:5432
- POSTGRES_DB=data
- GQLUG_ENDPOINT_URL=http://gql_ug:8000/gql
- JWTPUBLICKEYURL=http://frontend:8000/oauth/publickey
- JWTRESOLVEUSERPATHURL=http://frontend:8000/oauth/userinfo
- DEMO=True
healthcheck:
# definice, umoznujici provest test, zda je kontejner v poradku
test: "curl -f -H 'Content-Type: application/json' -X POST -d '{\"query\":\"query{__schema{types{name}}}\"}' http://localhost:8000/gql || exit 1"
interval: 60s
retries: 3
start_period: 60s
timeout: 10s
restart: on-failure:3 # nedojde k restartu pokud je kontejner "unhealthy", maximalne 3 pokusy
ports:
- 33013:8000
frontend:
image: hrbolek/frontend
environment:
- DEMO=False
- GQL_PROXY=http://apollo:3000/api/gql/
ports:
- 33001:8000
volumes:
# for development
- ./server/htmls:/app/server/htmls
- ./server/config.json:/app/server/config.json