-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
58 lines (53 loc) · 1.82 KB
/
docker-compose.yaml
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
services:
# We use a service called localhost to be able to address the keycloak service as "localhost:8443" in the
# application.yaml of our application. Using "keycloak:8443" is not possible as spring would then redirect the user to
# "keycloak:8443" to login, but that is a host that is not available on the host system. The spring boot oauth
# implementation is very restrictive on the issuer and therefore creates errors if the hosts used by it and the user
# to connect to keycloak differ.
# See also:
# - https://github.com/spring-projects/spring-security/issues/14633
# - https://github.com/keycloak/keycloak/issues/29783
# - https://github.com/keycloak/keycloak/issues/24252
# - https://medium.com/@kostapchuk/integrating-keycloak-with-spring-boot-in-a-dockerized-environment-813eab1f140c
localhost:
image: alpine:3.21
command: sleep infinity
ports:
- "8443:8443" # Keycloak port
- "8080:8080" # Webapp port
webapp:
image: ris-norms-app:001
container_name: webapp
build:
context: .
dockerfile: DockerfileApp
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres14:5432/risnorms
- REDIS_HOST=redis
- SPRING_PROFILES_ACTIVE=local-docker
network_mode: "service:localhost"
depends_on:
postgres14:
condition: service_healthy
redis:
condition: service_healthy
keycloak:
condition: service_healthy
volumes:
- ./local-storage:/app/.local-storage
postgres14:
extends:
file: docker-compose-services.yaml
service: postgres14
redis:
extends:
file: docker-compose-services.yaml
service: redis
keycloak:
extends:
file: docker-compose-services.yaml
service: keycloak
network_mode: "service:localhost"
ports: []
volumes:
postgres14-data: