-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
198 lines (185 loc) · 5.8 KB
/
docker-compose.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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
services:
backend-dependencies-build:
image: ${IMAGE_BACKEND_DEPENDENCIES}
build:
context: .
dockerfile: Dockerfile
target: geoviite-backend-dependencies
args:
- IMAGE_BASE_BACKEND_BUILD=${IMAGE_BASE_BACKEND_BUILD}
backend-build:
image: ${IMAGE_BACKEND}
depends_on:
backend-dependencies-build:
condition: service_completed_successfully
build:
context: .
dockerfile: Dockerfile
target: geoviite-backend-build
args:
- IMAGE_BASE_BACKEND_BUILD=${IMAGE_BASE_BACKEND_BUILD}
- IMAGE_BACKEND_DEPENDENCIES=${IMAGE_BACKEND_DEPENDENCIES}
frontend-build:
image: ${IMAGE_FRONTEND}
build:
context: .
dockerfile: Dockerfile
target: geoviite-frontend-build
args:
- IMAGE_BASE_FRONTEND_BUILD=${IMAGE_BASE_FRONTEND_BUILD}
distribution-build:
image: ${IMAGE_DISTRIBUTION}
command: "echo Done" # We don't want the build container to start as a service.
depends_on:
backend-build:
condition: service_completed_successfully
frontend-build:
condition: service_completed_successfully
build:
context: .
dockerfile: Dockerfile
target: geoviite-distribution-build
args:
IMAGE_BASE_BACKEND_BUILD: ${IMAGE_BASE_BACKEND_BUILD} # Needed for the geoviite-distribution-build-combiner
IMAGE_BASE_DISTRIBUTION: ${IMAGE_BASE_DISTRIBUTION}
IMAGE_BACKEND: ${IMAGE_BACKEND}
IMAGE_FRONTEND: ${IMAGE_FRONTEND}
postgres-service:
image: ${IMAGE_DB}
build: docker-images/geoviite-postgres
environment:
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- ${HOST_PORT_DB}:5432
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 2s
timeout: 2s
retries: 5
test-postgres-service:
extends:
service: postgres-service
ports: !override
- ${HOST_PORT_DB_TEST}:5432
backend:
image: ${IMAGE_DISTRIBUTION}
depends_on:
distribution-build:
condition: service_completed_successfully
postgres-service:
condition: service_healthy
environment:
DB_URL: postgres-service/${DB_NAME}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
SPRING_PROFILES_ACTIVE: noauth,backend,static-fileserver
ports:
- ${HOST_PORT_GEOVIITE}:8080
healthcheck:
test: "wget --spider --quiet http://localhost:8080/actuator/health || exit 1"
interval: 5s
timeout: 1s
retries: 20
ext-api:
extends:
service: backend
environment:
SPRING_PROFILES_ACTIVE: noauth,ext-api
ports: !override
- ${HOST_PORT_GEOVIITE_EXT_API}:8080
backend-unit-tests:
image: ${IMAGE_BACKEND}
command: ./gradlew --no-daemon --offline test --tests *Test
depends_on:
backend-build:
condition: service_completed_successfully
backend-integration-tests:
image: ${IMAGE_BACKEND}
command: |
./gradlew --no-daemon --offline integrationtest --tests *IT
depends_on:
backend-build:
condition: service_completed_successfully
test-postgres-service:
condition: service_healthy
environment:
DB_URL: test-postgres-service/${DB_NAME}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
backend-integration-tests-without-cache:
extends:
service:
backend-integration-tests
command: |
./gradlew --no-daemon --offline integrationtest-without-cache --tests "*DaoIT"
e2e-backend:
image: ${IMAGE_DISTRIBUTION}
depends_on:
distribution-build:
condition: service_completed_successfully
test-postgres-service:
condition: service_healthy
e2e-chrome-service:
condition: service_started
environment:
DB_URL: test-postgres-service/${DB_NAME}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
SPRING_PROFILES_ACTIVE: e2e,noauth,backend,static-fileserver
RATKO_ENABLED: true
RATKO_URL: ${E2E_URL_RATKO}
PROJEKTIVELHO_ENABLED: true
PROJEKTIVELHO_URL: ${E2E_URL_PROJEKTIVELHO}
ports:
- ${HOST_PORT_GEOVIITE_E2E}:8080
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: "wget --spider --quiet http://localhost:8080/actuator/health || exit 1"
interval: 5s
timeout: 1s
retries: 20
e2e-chrome-service:
image: ${IMAGE_E2E_SELENIUM_CHROME}
shm_size: "2gb"
privileged: true
environment:
- SCREEN_WIDTH=1920
- SCREEN_HEIGHT=1080
- SE_ENABLE_TRACING=false
- SE_NODE_SESSION_TIMEOUT=600
- SE_NODE_MAX_SESSIONS=8
ports:
- ${HOST_PORT_GEOVIITE_E2E_BROWSER_CHROME}:4444
- ${HOST_PORT_GEOVIITE_E2E_BROWSER_VNC}:7900
- ${HOST_PORT_GEOVIITE_E2E_BROWSER_VNC_SERVER}:5900
extra_hosts:
- "host.docker.internal:host-gateway"
e2e-tests:
image: ${IMAGE_BACKEND}
command: |
./gradlew --no-daemon --offline test --tests "*UI"
depends_on:
backend-build:
condition: service_completed_successfully
e2e-backend:
condition: service_healthy
e2e-chrome-service:
condition: service_started
environment:
DB_URL: test-postgres-service/${DB_NAME}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
E2E_REMOTE_SELENIUM_HUB_ENABLED: true
E2E_URL_REMOTE_SELENIUM_HUB: ${E2E_URL_REMOTE_SELENIUM_HUB}
E2E_URL_GEOVIITE: ${E2E_URL_GEOVIITE}
E2E_URL_RATKO: ${E2E_URL_RATKO}
E2E_URL_PROJEKTIVELHO: ${E2E_URL_PROJEKTIVELHO}
HOST_PORT_GEOVIITE_E2E_PROJEKTIVELHO: ${HOST_PORT_GEOVIITE_E2E_PROJEKTIVELHO}
ports:
- ${HOST_PORT_GEOVIITE_E2E_RATKO}:12345
- ${HOST_PORT_GEOVIITE_E2E_PROJEKTIVELHO}:12346
extra_hosts:
- "host.docker.internal:host-gateway"