@@ -11,9 +11,11 @@ services:
1111 - ./:/usr/src/app
1212 - /usr/src/app/node_modules
1313 - ./test/integration/api.env:/usr/src/app/.env
14+ - ../keycloak:/keycloak:ro
1415 depends_on :
1516 - mongodb
1617 - rabbitmq
18+ - keycloak
1719 # - accounting
1820 stdin_open : true
1921 tty : true
@@ -32,10 +34,20 @@ services:
3234 condition : service_healthy
3335 api :
3436 condition : service_started
35- command : dockerize -wait http://api:4000/.well-known/apollo/server-health -timeout 30s yarn jest --config=./test/integration/jest.config.js --runInBand test/integration
37+ keycloak :
38+ condition : service_healthy
39+ environment :
40+ - KEYCLOAK_URL=http://keycloak:8180
41+ entrypoint : ["/bin/bash", "-c"]
42+ command :
43+ - |
44+ dockerize -wait http://api:4000/.well-known/apollo/server-health -timeout 30s -wait http://keycloak:8180/health/ready -timeout 60s &&
45+ /keycloak/setup.sh &&
46+ yarn jest --config=./test/integration/jest.config.js --runInBand test/integration
3647 volumes :
3748 - ./:/usr/src/app
3849 - /usr/src/app/node_modules
50+ - ../keycloak:/keycloak:ro
3951
4052 rabbitmq :
4153 image : rabbitmq:3-management
@@ -52,6 +64,29 @@ services:
5264 timeout : 3s
5365 retries : 5
5466
67+ keycloak :
68+ image : quay.io/keycloak/keycloak:23.0
69+ environment :
70+ - KEYCLOAK_ADMIN=admin
71+ - KEYCLOAK_ADMIN_PASSWORD=admin
72+ - KC_HTTP_PORT=8180
73+ - KC_HOSTNAME_STRICT=false
74+ - KC_HOSTNAME_STRICT_HTTPS=false
75+ - KC_HTTP_ENABLED=true
76+ - KC_HEALTH_ENABLED=true
77+ ports :
78+ - 8180:8180
79+ command :
80+ - start-dev
81+ volumes :
82+ - keycloak-test-data:/opt/keycloak/data
83+ - ../keycloak:/opt/keycloak/config
84+ healthcheck :
85+ test : ["CMD-SHELL", "exec 3<>/dev/tcp/127.0.0.1/8180;echo -e 'GET /health/ready HTTP/1.1\r\nhost: http://localhost\r\nConnection: close\r\n\r\n' >&3;if [ $? -eq 0 ]; then echo 'Healthcheck Successful';exit 0;else echo 'Healthcheck Failed';exit 1;fi;"]
86+ interval : 10s
87+ timeout : 5s
88+ retries : 10
89+
5590 # accounting:
5691 # image: codexteamuser/codex-accounting:prod
5792 # env_file:
@@ -61,3 +96,4 @@ services:
6196
6297volumes :
6398 mongodata-test :
99+ keycloak-test-data :
0 commit comments