-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
260 lines (238 loc) · 7.92 KB
/
compose.yaml
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# This is for use during development.
# TODO: it would be more user-friendly and more prod-like if we put a Traefik proxy in the network.
services:
migrate:
image: redgate/flyway:10.17.0
volumes:
- ./migrations:/flyway/sql
command: migrate
env_file:
- docker/local/flyway.env
environment:
FLYWAY_URL: jdbc:postgresql://postgres:5432/${DB_NAME:-postgres}
FLYWAY_USER: postgres
depends_on:
- postgres
kleinverbruik:
build:
context: ./kleinverbruik
ports:
- 127.0.0.1:80:80
gradle-base:
image: gradle:8.10.0-jdk21
working_dir: /home/gradle/zero
user: gradle
volumes:
- .:/home/gradle/zero
- gradle-base-cache:/home/gradle/.gradle
entrypoint: gradle --project-cache-dir=/tmp/gradle
gradle-base-17:
extends:
service: gradle-base
image: gradle:8.10.0-jdk17
zorm-test:
extends:
service: gradle-base
depends_on:
- postgres
volumes:
- gradle-zorm-test-home:/home/gradle/.gradle
command: zorm:test --no-daemon
env_file:
- docker/local/ztor.env
environment:
POSTGRES_URL: jdbc:postgresql://postgres:5432/test
POSTGRES_USER: postgres
zorm-test-github-actions:
extends:
service: gradle-base
depends_on:
- postgres-github-actions
volumes:
- gradle-zorm-test-home:/home/gradle/.gradle
command: zorm:test --no-daemon
environment:
POSTGRES_URL: jdbc:postgresql://postgres-github-actions:5432/postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: github-actions
## Production version
ztor-production:
build:
dockerfile: ./docker/production/ztor/Dockerfile
context: .
user: 1000:1000
ports:
- 127.0.0.1:8082:8082
env_file:
- docker/local/ztor.env
environment:
POSTGRES_URL: jdbc:postgresql://postgres:5432/postgres
POSTGRES_USER: postgres
BASE_URL: http://localhost:8082
CORS_ALLOW_ORIGIN_PATTERN: 'http://localhost:3000'
# Keycloak test realm JWK
ACCESS_TOKEN_JWK: |
{
"kid": "n-X5BeXFe6pIXhDBsDu2mQ2VYc23RSZCFRU5Y6IuzC8",
"kty": "OKP",
"alg": "EdDSA",
"use": "sig",
"crv": "Ed25519",
"x": "ILokSbk8EKH-Q1aWo_TguuDRccoSVfEbmGSbm5gcn5I"
}
# You can use this container to run one-off commands, for example:
# docker compose run --rm ztor-gradle-with-db ztor:run --args=fudura-import-hessenpoort
ztor-gradle-with-db:
extends:
service: gradle-base
depends_on:
- postgres
env_file:
- docker/local/ztor.env
environment:
POSTGRES_URL: jdbc:postgresql://postgres:5432/${DB_NAME:-postgres}
POSTGRES_USER: postgres
ztor-test:
extends:
service: ztor-gradle-with-db
volumes:
- gradle-test-cache:/home/gradle/.gradle
command: ztor:test --no-daemon
environment:
POSTGRES_URL: jdbc:postgresql://postgres:5432/test
ztor-test-create-schema:
extends:
service: ztor-echo-schema-sql
command: ztor:run --args=create-schema
environment:
# other database
POSTGRES_URL: jdbc:postgresql://postgres:5432/test
## Recompiles on source code changes.
## Do ensure that the two Gradle containers have independent Home directories and Project cache directories.
ztor-build-once:
extends:
service: gradle-base
volumes:
- gradle-build-once-cache:/home/gradle/.gradle
command: ztor:buildFatJar --no-daemon
## Recompiles on source code changes.
## Do ensure that the two Gradle containers have independent Home directories and Project cache directories.
ztor-build:
extends:
service: gradle-base
volumes:
- gradle-build-cache:/home/gradle/.gradle
command: ztor:classes
## Runs Ktor web server and reloads classes if the compiled .class file changes.
## Do ensure that the two Gradle containers have independent Home directories and Project cache directories.
ztor-run:
extends:
service: ztor-gradle-with-db
volumes:
- gradle-run-cache:/home/gradle/.gradle
command: ztor:run
ports:
- 127.0.0.1:8082:8082
environment:
BASE_URL: http://localhost:8082
CORS_ALLOW_ORIGIN_PATTERN: 'http://localhost:\d{2,5}'
# Keycloak test realm JWK
ACCESS_TOKEN_JWK: |
{
"kid": "n-X5BeXFe6pIXhDBsDu2mQ2VYc23RSZCFRU5Y6IuzC8",
"kty": "OKP",
"alg": "EdDSA",
"use": "sig",
"crv": "Ed25519",
"x": "ILokSbk8EKH-Q1aWo_TguuDRccoSVfEbmGSbm5gcn5I"
}
ztor-echo-schema-sql:
extends:
service: ztor-gradle-with-db
volumes:
- gradle-cmd-cache:/home/gradle/.gradle
command: ztor:run --args=echo-schema-sql
environment:
# other database
POSTGRES_URL: jdbc:postgresql://postgres:5432/gen
ztor-create-schema:
extends:
service: ztor-echo-schema-sql
command: ztor:run --args=create-schema
environment:
# other database
POSTGRES_URL: jdbc:postgresql://postgres:5432/gen
vallum-test:
extends:
service: gradle-base
command: vallum:test
volumes:
- gradle-vallum-test-cache:/home/gradle/.gradle
- gradle-vallum-test-stuff:/home/gradle/zero/.gradle
depends_on:
- postgres
env_file:
- docker/local/ztor.env
environment:
POSTGRES_URL: jdbc:postgresql://postgres:5432/postgres
POSTGRES_USER: postgres
BASE_URL: http://localhost:8082
CORS_ALLOW_ORIGIN_PATTERN: 'http://localhost:\d{2,5}'
# Keycloak test realm JWK
ACCESS_TOKEN_JWK: |
{
"kid": "n-X5BeXFe6pIXhDBsDu2mQ2VYc23RSZCFRU5Y6IuzC8",
"kty": "OKP",
"alg": "EdDSA",
"use": "sig",
"crv": "Ed25519",
"x": "ILokSbk8EKH-Q1aWo_TguuDRccoSVfEbmGSbm5gcn5I"
}
npm:
image: node:23
working_dir: /app/frontend
volumes:
- .:/app
- npm-cache:/root/.npm
entrypoint: npm
environment:
VITE_ZTOR_URL: http://localhost:8082
frontend:
extends:
service: npm
command: run start
ports:
- 127.0.0.1:3000:3000
## first run `docker-compose run --rm npm run build`
frontend-static:
build:
context: docker/local/caddy
volumes:
- ./frontend/dist:/srv
ports:
- 127.0.0.1:2015:2015
postgres:
image: postgres:17.2
ports:
- 127.0.0.1:5432:5432
volumes:
- postgres:/var/lib/postgresql/data
command: "-c log_statement=all"
env_file:
- docker/local/postgres.env
postgres-github-actions:
image: postgres:17.2
environment:
POSTGRES_PASSWORD: github-actions
volumes:
gradle-vallum-test-cache:
gradle-vallum-test-stuff:
gradle-base-cache:
gradle-build-cache:
gradle-build-once-cache:
gradle-zorm-test-home:
gradle-test-cache:
gradle-run-cache:
gradle-cmd-cache:
npm-cache:
postgres: