-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
70 lines (64 loc) · 1.4 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
version: '3'
networks:
kong-blogposts:
driver: bridge
services:
api-service:
build: ./api-service
networks:
- kong-blogposts
expose:
- 80
ports:
- "80:80"
kong-database:
container_name: kong-database
image: postgres:9.6
restart: always
networks:
- kong-blogposts
environment:
- POSTGRES_USER=kong
- POSTGRES_DB=kong
healthcheck:
test: ["CMD", "pg_isready", "-U", "kong"]
interval: 10s
timeout: 5s
retries: 5
kong-migration:
image: kong:1.5
depends_on:
- "kong-database"
container_name: kong-migration
networks:
- kong-blogposts
restart: on-failure
environment:
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-database
- KONG_PG_DATABASE=kong
command: kong migrations bootstrap
kong:
container_name: kong
image: kong:1.5
depends_on:
- "kong-migration"
- "kong-database"
restart: always
networks:
- kong-blogposts
environment:
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-database
- KONG_PG_DATABASE=kong
- KONG_PROXY_LISTEN=0.0.0.0:8000
- KONG_ADMIN_LISTEN=0.0.0.0:8001
ports:
- 8000:8000
- 8001:8001
- 8443:8443
- 8444:8444
healthcheck:
test: ["CMD-SHELL","curl -I -s -L http://localhost:8000 || exit 1"]
interval: 5s
retries: 10