-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
100 lines (94 loc) · 2.7 KB
/
docker-compose.test.yml
File metadata and controls
100 lines (94 loc) · 2.7 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
services:
api:
build:
dockerfile: "./docker/Dockerfile.dev"
context: .
user: "node"
env_file:
- ./test/integration/api.env
volumes:
- ./:/usr/src/app
- /usr/src/app/node_modules
- ./test/integration/api.env:/usr/src/app/.env
- ./test/integration/keycloak:/keycloak:ro
depends_on:
- mongodb
- rabbitmq
- keycloak
stdin_open: true
tty: true
mongodb:
image: mongo:4.2.13
volumes:
- mongodata-test:/data/db
tests:
build:
dockerfile: "./docker/Dockerfile.dev"
context: .
depends_on:
rabbitmq:
condition: service_healthy
api:
condition: service_started
keycloak:
condition: service_healthy
environment:
- KEYCLOAK_URL=http://keycloak:8180
entrypoint: ["/bin/bash", "-c"]
command:
- |
dockerize -wait http://api:4000/.well-known/apollo/server-health -timeout 30s -wait http://keycloak:8180/health/ready -timeout 60s &&
/keycloak/setup.sh &&
yarn jest --config=./test/integration/jest.config.js --runInBand test/integration
volumes:
- ./:/usr/src/app
- /usr/src/app/node_modules
- ./test/integration/keycloak:/keycloak:ro
rabbitmq:
image: rabbitmq:3-management
ports:
- 15672:15672
- 5672:5672
volumes:
- ./test/integration/rabbit.definitions.json:/tmp/rabbit.definitions.json:ro
environment:
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbitmq_management load_definitions "/tmp/rabbit.definitions.json"
healthcheck:
test: ["CMD-SHELL", "rabbitmqctl status || exit 1"]
interval: 5s
timeout: 3s
retries: 5
keycloak:
image: quay.io/keycloak/keycloak:22.0
environment:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=admin
- KC_HTTP_PORT=8180
- KC_HOSTNAME_STRICT=false
- KC_HOSTNAME_STRICT_HTTPS=false
- KC_HTTP_ENABLED=true
- KC_HEALTH_ENABLED=true
- JAVA_OPTS_APPEND=-Djava.io.tmpdir=/opt/keycloak/data/tmp
ports:
- 8180:8180
command:
- start-dev
volumes:
- keycloak-test-data:/opt/keycloak/data
tmpfs:
- /tmp:size=128M
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/8180 && 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: 10s
retries: 15
start_period: 60s
# accounting:
# image: codexteamuser/codex-accounting:prod
# env_file:
# - ./test/integration/accounting.env
# volumes:
# - ./test/integration/accounting.env:/usr/src/app/.env
volumes:
mongodata-test:
keycloak-test-data: