-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
134 lines (126 loc) · 3.45 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
version: '3.9'
networks:
kong-net:
driver: bridge
keycloak-net:
services:
pokemon-service:
build:
context: .
dockerfile: ./devops/Dockerfile
hostname: pokemon-service
container_name: pokemon-service
networks:
- kong-net
volumes:
- ./src:/usr/src/app/src
environment:
- MONGO_DB_URL=mongodb://root:password@mongodb_pokemon:27017/pokemon?authSource=admin
- NODE_ENV=development
depends_on:
- mongo
- kong-api-gateway
mongo:
image: mongo:latest
container_name: mongodb_pokemon
restart: always
networks:
- kong-net
volumes:
- ./volumes/mongodbdata:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
MONGO_INITDB_DATABASE: pokemon
mongo-seed:
image: mongo:latest
container_name: mongodb_pokemon_seed
networks:
- kong-net
depends_on:
- mongo
volumes:
- ./config/data:/config/data
# Using upsert mode and upsertField id will replace existing db data if you try re-run mongo-seed service
command: mongoimport --host mongodb_pokemon -u root -p password --authenticationDatabase admin --db pokemon --collection gen1 --type json --file /config/data/pokemon-gen1.json --jsonArray --mode upsert --upsertFields id
kong-api-gateway:
image: cristianchiru/docker-kong-oidc
depends_on:
- kong-db
hostname: kong-api-gateway
container_name: kong-api-gateway
networks:
- kong-net
volumes:
- ./config/kong:/opt/kong
ports:
- '8000:8000/tcp' # Listener
- '8443:8443/tcp' # Listener (SSL)
- '127.0.0.1:8001:8001/tcp' # Admin API
- '127.0.0.1:8444:8444/tcp' # Admin API (SSL)
environment:
KONG_DATABASE: 'off'
KONG_ADMIN_ACCESS_LOG: /dev/stdout
KONG_ADMIN_ERROR_LOG: /dev/stderr
KONG_PROXY_ACCESS_LOG: /dev/stdout
KONG_PROXY_ERROR_LOG: /dev/stderr
KONG_ADMIN_LISTEN: '${KONG_ADMIN_LISTEN:-0.0.0.0:8001}'
KONG_PROXY_LISTEN: '${KONG_PROXY_LISTEN:-0.0.0.0:8000}'
KONG_DECLARATIVE_CONFIG: '/opt/kong/kong.yaml'
KONG_PLUGINS: bundled,oidc
healthcheck:
test: ['CMD', 'kong', 'health']
interval: 10s
timeout: 10s
retries: 10
restart: on-failure:5
security_opt:
- no-new-privileges
kong-db:
image: postgres:latest
restart: always
hostname: kong-db
container_name: kong-db
networks:
- kong-net
volumes:
- ./volumes/kongdbdata:/var/lib/postgresql/data
environment:
POSTGRES_USER: kong
POSTGRES_PASSWORD: kong
POSTGRES_DB: kong
keycloak-iam:
restart: always
build:
context: .
dockerfile: ./devops/Keycloak.Dockerfile
hostname: keycloak-iam
container_name: keycloak-iam
command: start-dev
networks:
- keycloak-net
ports:
- 9080:8080
- 9443:8443
environment:
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://keycloak-db:5432/keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: password
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
depends_on:
- keycloak-db
keycloak-db:
image: postgres:latest
restart: always
hostname: keycloak-db
container_name: keycloak-db
networks:
- keycloak-net
volumes:
- ./volumes/keycloakdbdata:/var/lib/postgresql/data
environment:
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
POSTGRES_DB: keycloak