forked from betagouv/monprojetsup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
99 lines (94 loc) · 3.29 KB
/
docker-compose.dev.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
version: '3.8'
services:
keycloakdb:
image: postgres:16
restart: always
environment:
POSTGRES_DB: ${KEYCLOAK_DB_NAME}
POSTGRES_USER: ${KEYCLOAK_DB_USER}
POSTGRES_PASSWORD: ${KEYCLOAK_DB_PASSWORD}
PGPORT: ${KEYCLOAK_DB_PORT}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
volumes:
- ./keycloak/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./keycloak/db:/var/lib/postgresql/data
keycloak:
image: quay.io/keycloak/keycloak:24.0
depends_on:
keycloakdb:
condition: service_healthy
environment:
KC_DB: ${KEYCLOAK_DB_NAME}
KC_DB_URL: jdbc:postgresql://keycloakdb:${KEYCLOAK_DB_PORT}/${KEYCLOAK_DB_NAME}
KC_DB_USERNAME: ${KEYCLOAK_DB_USER}
KC_DB_PASSWORD: ${KEYCLOAK_DB_PASSWORD}
KEYCLOAK_ADMIN: ${KEYCLOAK_USER}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_PASSWORD}
KC_HEALTH_ENABLED: true
restart: always
healthcheck:
test:
[
'CMD-SHELL',
'[ -f /tmp/HealthCheck.java ] || echo "public class HealthCheck { public static void main(String[] args) throws java.lang.Throwable { System.exit(java.net.HttpURLConnection.HTTP_OK == ((java.net.HttpURLConnection)new java.net.URL(args[0]).openConnection()).getResponseCode() ? 0 : 1); } }" > /tmp/HealthCheck.java && java /tmp/HealthCheck.java http://localhost:8080/health/live'
]
interval: 5s
timeout: 5s
retries: 30
ports:
- ${KEYCLOAK_PORT_EXPOSED}:${KEYCLOAK_PORT}
entrypoint: /opt/keycloak/bin/kc.sh start-dev
appdb:
image: postgres:16
restart: always
environment:
POSTGRES_DB: ${APP_DB_NAME}
POSTGRES_USER: ${APP_DB_USER}
POSTGRES_PASSWORD: ${APP_DB_PASSWORD}
PGPORT: ${APP_DB_PORT}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
ports:
- ${APP_DB_PORT_EXPOSED}:${APP_DB_PORT}
volumes:
- ./app/db:/var/lib/postgresql/data
appfront:
image: node:22
restart: on-failure
working_dir: /root/app
ports:
- ${APP_FRONT_PORT}:${APP_FRONT_PORT}
volumes:
- ./app/front:/root/app
command: sh -c "npm install && npx playwright install --with-deps && npm run dev"
appback:
image: maven:3-eclipse-temurin-17-alpine
platform: linux/amd64
restart: on-failure
working_dir: /root/app
depends_on:
keycloak:
condition: service_healthy
ports:
- ${APP_BACK_PORT}:${APP_BACK_PORT}
volumes:
- ./app/back:/root/app
environment:
- SERVER_PORT=${APP_BACK_PORT}
- DB_URL=jdbc:postgresql://appdb:${APP_DB_PORT}/${APP_DB_NAME}
- DB_USER=${APP_DB_USER}
- DB_PASSWORD=${APP_DB_PASSWORD}
- CORS_ORIGINPATTERNS=http://appfront:${APP_FRONT_PORT},http://localhost:${APP_FRONT_PORT}
- SUGGESTIONS_API_URL=http://localhost:8004/api/1.2
- KEYCLOAK_CLIENT_ID=mps-cli
- KEYCLOAK_CLIENT_SECRET=anfoYhY7PNxIhgEthcWdbq2P4XPJ90Aw
- KEYCLOAK_ROYAUME_URL=http://keycloak:${KEYCLOAK_PORT}/realms/avenirs
- KEYCLOAK_ROYAUME_URL_JWT_VERIF=http://localhost:${KEYCLOAK_PORT_EXPOSED}/realms/avenirs
command: sh -c " mvn clean compile exec:java -Dexec.mainClass=fr.gouv.monprojetsup.MonProjetSupApplication"