-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
148 lines (139 loc) · 3.51 KB
/
docker-compose.yml
File metadata and controls
148 lines (139 loc) · 3.51 KB
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
version: '3.8'
services:
postgres:
image: postgres:16
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U keycloak -d keycloak"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
networks:
- poc-network
redis:
image: redis:7-alpine
command: redis-server --appendonly yes
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
start_period: 5s
networks:
- poc-network
keycloak:
image: quay.io/keycloak/keycloak:latest
command:
- start-dev
- --import-realm
- --features=token-exchange
environment:
KC_FEATURES: token-exchange
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://postgres:5432/keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: password
KC_HEALTH_ENABLED: true
ports:
- "8080:8080"
volumes:
- ./.keycloak/realms:/opt/keycloak/data/import
depends_on:
postgres:
condition: service_healthy
restart: on-failure:5
healthcheck:
test: ["CMD-SHELL", "exec 3<>/dev/tcp/localhost/8080 && echo -e 'GET /health/ready HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && cat <&3 | grep -q '200 OK'"]
interval: 10s
timeout: 5s
retries: 10
start_period: 60s
networks:
- poc-network
api:
build:
context: ./samples/Poc.Api
dockerfile: Dockerfile
ports:
- "5149:8080"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- Keycloak__Authority=http://keycloak:8080/realms/poc
- Keycloak__Audience=api
- Redis__ConnectionString=redis:6379
depends_on:
keycloak:
condition: service_healthy
redis:
condition: service_healthy
networks:
- poc-network
internalapi:
build:
context: ./samples/Poc.InternalApi
dockerfile: Dockerfile
ports:
- "7200:8080"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- Keycloak__Authority=http://keycloak:8080/realms/poc
- Keycloak__Audience=internalapi
- Redis__ConnectionString=redis:6379
depends_on:
keycloak:
condition: service_healthy
redis:
condition: service_healthy
networks:
- poc-network
yarp:
build:
context: .
dockerfile: samples/Poc.Yarp/Dockerfile
ports:
- "5198:8080"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- Keycloak__Authority=http://keycloak:8080/realms/poc
- Keycloak__Url=http://keycloak:8080
- Keycloak__Audience=account
- FrontEnd__RedirectAfterLogin=http://frontend:3000
- ReverseProxy__Clusters__apiCluster__Destinations__destination1__Address=http://api:8080
- Redis__ConnectionString=redis:6379
depends_on:
keycloak:
condition: service_healthy
api:
condition: service_started
redis:
condition: service_healthy
networks:
- poc-network
frontend:
build:
context: ./samples/poc-frontend
dockerfile: Dockerfile
ports:
- "3000:80"
depends_on:
- yarp
networks:
- poc-network
volumes:
postgres_data:
redis_data:
networks:
poc-network:
driver: bridge