-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
134 lines (127 loc) · 5.11 KB
/
docker-compose.yml
File metadata and controls
134 lines (127 loc) · 5.11 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
services:
inner-circle-items-api-db:
image: postgres:14
container_name: inner-circle-items-api-db
profiles:
- DbOnly
- MockForDevelopment
- MockForTests
- MockForPullRequest
environment:
POSTGRES_DB: inner-circle-items-api-db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 7501:5432
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- inner-circle-items-api-network
# https://event-driven.io/en/automatically_connect_pgadmin_to_database/
inner-circle-items-api-pgadmin:
image: dpage/pgadmin4
container_name: inner-circle-items-api-pgadmin
profiles:
- DbOnly
- MockForDevelopment
depends_on:
inner-circle-items-api-db:
condition: service_healthy
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: inner-circle-items-api-db
PGADMIN_DEFAULT_EMAIL: admin@admin.org
PGADMIN_DEFAULT_PASSWORD: postgres
PGADMIN_CONFIG_SERVER_MODE: 'False'
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'
# these 2 variables PGADMIN_CONFIG_PROXY_X_HOST_COUNT and PGADMIN_CONFIG_PROXY_X_PREFIX_COUNT
# are needed to enable PgAdmin in Codespaces scenario when it is behind a reverse proxy
# https://github.com/orgs/community/discussions/17918
PGADMIN_CONFIG_PROXY_X_HOST_COUNT: 1
PGADMIN_CONFIG_PROXY_X_PREFIX_COUNT: 1
ports:
- 9501:80
networks:
- inner-circle-items-api-network
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
# list of available config properties can be found here in the source code https://github.com/pgadmin-org/pgadmin4/blob/00dbe58125f0304186f1af5374c9c43bc22d0410/web/pgadmin/utils/__init__.py#L505
# Password is no longer a part of this list as it seems to be when the linked article was written
- ${LOCAL_WORKSPACE_FOLDER:-.}/pgAdmin.json:/pgadmin4/servers.json
inner-circle-items-api:
container_name: inner-circle-items-api
profiles:
- MockForTests
- MockForPullRequest
depends_on:
inner-circle-items-api-db:
condition: service_healthy
inner-circle-items-api-mock-server:
condition: service_started
build:
dockerfile: ./Api/Dockerfile
context: .
args:
EXCLUDE_UNIT_TESTS_FROM_BUILD: "true"
environment:
- ASPNETCORE_ENVIRONMENT=MockForPullRequest
ports:
- 6501:80
networks:
- inner-circle-items-api-network
inner-circle-items-api-mock-server:
container_name: 'inner-circle-items-api-mock-server'
profiles:
- MockForDevelopment
- MockForTests
- MockForPullRequest
image: mockserver/mockserver:5.15.0
command: -logLevel INFO
ports:
- 8501: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-items-api-network
inner-circle-items-api-karate-tests:
container_name: 'inner-circle-items-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-items-api:
condition: service_started
inner-circle-items-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"
AUTH_SECOND_TENANT_LOGIN_WITH_ALL_PERMISSIONS: "second-tenant-login-with-all-permissions"
AUTH_SECOND_TENANT_PASSWORD_WITH_ALL_PERMISSIONS: "second-tenant-password-with-all-permissions"
AUTH_LOGIN_WITHOUT_PERMISSIONS: "first-tenant-login-without-permissions"
AUTH_PASSWORD_WITHOUT_PERMISSIONS: "first-tenant-password-without-permissions"
# here the port is 1080 because it needs to be an internal port, not an external which is 8501 in this case
AUTH_API_ROOT_URL: "http://inner-circle-items-api-mock-server:1080/api/auth"
API_ROOT_URL: "http://inner-circle-items-api/api"
SHOULD_USE_FAKE_EXTERNAL_DEPENDENCIES: "true"
networks:
- inner-circle-items-api-network
networks:
inner-circle-items-api-network: