Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
99 lines (93 loc) · 3.42 KB
/
Copy pathdocker-compose.yml
File metadata and controls
99 lines (93 loc) · 3.42 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
services:
inner-circle-compensations-api-db:
image: postgres:14
container_name: inner-circle-compensations-api-db
profiles:
- DbOnly
- MockForDevelopment
- MockForTests
- MockForPullRequest
environment:
POSTGRES_DB: inner-circle-compensations-api-db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 7508:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- inner-circle-compensations-api-network
inner-circle-compensations-api:
container_name: inner-circle-compensations-api
profiles:
- MockForTests
- MockForPullRequest
depends_on:
inner-circle-compensations-api-db:
condition: service_healthy
inner-circle-compensations-api-mock-server:
condition: service_started
build:
dockerfile: ./Api/Dockerfile
context: .
args:
EXCLUDE_UNIT_TESTS_FROM_BUILD: "true"
environment:
- ASPNETCORE_ENVIRONMENT=MockForPullRequest
- ASPNETCORE_HTTP_PORTS=80
ports:
- 6508:80
networks:
- inner-circle-compensations-api-network
inner-circle-compensations-api-mock-server:
container_name: 'inner-circle-compensations-api-mock-server'
profiles:
- MockForDevelopment
- MockForTests
- MockForPullRequest
image: mockserver/mockserver:5.15.0
command: -logLevel INFO
ports:
- 8508:1080
volumes:
# this is needed so that we can spin it up from within Dev Container where LOCAL_WORKSPACE_FOLDER is defined and from a simple OS terminal of the repo root
- ${LOCAL_WORKSPACE_FOLDER:-.}/e2e/mock-server-initialization.json:/config/mock-server-initialization.json
environment:
SERVER_PORT: 1080
MOCKSERVER_INITIALIZATION_JSON_PATH: /config/mock-server-initialization.json
networks:
- inner-circle-compensations-api-network
inner-circle-compensations-api-karate-tests:
container_name: 'inner-circle-compensations-api-karate-tests'
profiles:
- MockForPullRequest
build:
dockerfile: ./KarateDockerfile
context: ./e2e
# service_started is not what we need, we need deps to be healthy and ready, this needs to be implemented in api and mock-server first
depends_on:
inner-circle-compensations-api:
condition: service_started
inner-circle-compensations-api-mock-server:
condition: service_started
# restart twice in case of not ready db or network failures
restart: on-failure:2
command: ["karate", "/karate"]
volumes:
# similar to mock-server volumes we need to support both runs: from Dev Container and from OS
- ${LOCAL_WORKSPACE_FOLDER:-.}:/karate
environment:
AUTH_FIRST_TENANT_LOGIN_WITH_ALL_PERMISSIONS: "first-tenant-login-with-all-permissions"
AUTH_FIRST_TENANT_PASSWORD_WITH_ALL_PERMISSIONS: "first-tenant-password-with-all-permissions"
# here the port is 1080 because it needs to be an internal port, not an external which is 8504 in this case
AUTH_API_ROOT_URL: "http://inner-circle-compensations-api-mock-server:1080/api/auth"
API_ROOT_URL: "http://inner-circle-compensations-api/api/compensations"
CORS_ALLOWED_ORIGINS: "*"
SHOULD_USE_FAKE_EXTERNAL_DEPENDENCIES: "true"
networks:
- inner-circle-compensations-api-network
networks:
inner-circle-compensations-api-network: