-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
257 lines (243 loc) · 7.49 KB
/
docker-compose.yml
File metadata and controls
257 lines (243 loc) · 7.49 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
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
name: osrd
volumes:
psql_data:
valkey_data:
rabbitmq_data:
s3_data:
services:
postgres:
image: ${OSRD_POSTGIS_IMAGE:-postgis/postgis:16-3.4-alpine}
container_name: osrd-postgres
user: postgres
restart: unless-stopped
ports: [ "5432:5432" ]
environment:
POSTGRES_PASSWORD: "password"
volumes:
- "psql_data:/var/lib/postgresql/data"
- "./docker/init_db.sql:/docker-entrypoint-initdb.d/init.sql"
healthcheck:
test: [ "CMD", "pg_isready", "-d", "postgres://osrd:password@postgres/osrd" ]
start_period: 4s
interval: 5s
retries: 20
valkey:
image: valkey/valkey:alpine
container_name: osrd-valkey
restart: unless-stopped
ports: [ "6379:6379" ]
volumes:
- "valkey_data:/data"
- "./docker/valkey.conf:/etc/valkey.conf"
command: "valkey-server /etc/valkey.conf --save 30 1 --loglevel warning"
healthcheck:
test: [ "CMD", "valkey-cli", "ping" ]
start_period: 4s
interval: 5s
retries: 20
openfga-migrate:
depends_on:
postgres: { condition: service_healthy }
image: openfga/openfga:latest
container_name: osrd-openfga-migrate
command: migrate
environment:
OPENFGA_DATASTORE_ENGINE: "postgres"
OPENFGA_DATASTORE_URI: "postgres://osrd:password@postgres:5432/osrd?search_path=openfga"
openfga:
depends_on:
openfga-migrate:
condition: service_completed_successfully
image: openfga/openfga:latest
container_name: osrd-openfga
environment:
OPENFGA_DATASTORE_ENGINE: "postgres"
OPENFGA_DATASTORE_URI: "postgres://osrd:password@postgres:5432/osrd?search_path=openfga"
OPENFGA_HTTP_ADDR: "0.0.0.0:8091"
OPENFGA_GRPC_ADDR: "0.0.0.0:8093"
OPENFGA_PLAYGROUND_PORT: 8092
command: run
ports:
- "8091:8091" # http
- "8092:8092" # playground
rabbitmq:
image: rabbitmq:4-management
container_name: osrd-rabbitmq
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: osrd
RABBITMQ_DEFAULT_PASS: password
volumes:
- "./docker/rabbitmq.conf:/etc/rabbitmq/conf.d/99-osrd.conf"
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: [ "CMD", "rabbitmqctl", "status" ]
interval: 5s
timeout: 5s
retries: 20
s3:
image: rustfs/rustfs
container_name: s3
ports:
- 9900:9900
- 9901:9901
volumes:
- s3_data:/data
environment:
RUSTFS_ACCESS_KEY: access_key
RUSTFS_SECRET_KEY: secret_key
RUSTFS_ADDRESS: ":9900"
RUSTFS_CONSOLE_ADDRESS: ":9901"
healthcheck:
test:
[
"CMD",
"curl", "--fail", "--fail-early",
"http://localhost:9900/health",
"http://localhost:9901/rustfs/console/health",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
s3_init:
image: minio/mc
container_name: s3_init
volumes:
- ./docker/create_bucket.sh:/create_bucket.sh
depends_on:
s3:
condition: service_healthy
environment:
AWS_ACCESS_KEY_ID: access_key
AWS_SECRET_ACCESS_KEY: secret_key
AWS_ENDPOINT_URL_S3: http://s3:9900
entrypoint: ["/create_bucket.sh", "osrd"]
core:
# This is a dummy container to build the core image
# and document/provide parameters to other compose files
image: ghcr.io/openrailassociation/osrd-${RELEASE_CHANNEL-edge}/osrd-core:${TAG-dev}
container_name: osrd-core-dummy
depends_on:
rabbitmq: { condition: service_healthy }
valkey: { condition: service_healthy }
build:
context: core
dockerfile: Dockerfile
additional_contexts:
test_data: tests/data
static_assets: assets
args:
OSRD_GIT_DESCRIBE: development
environment:
# Actual values in ./docker/osrdyne.yml (please maintain consistency)
# Provided here only for reuse in compose layers and doc
CORE_EDITOAST_URL: "http://editoast"
JAVA_TOOL_OPTIONS: "-javaagent:/app/opentelemetry-javaagent.jar"
CORE_MONITOR_TYPE: "opentelemetry"
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: "grpc"
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://jaeger:4317"
OTEL_METRICS_EXPORTER: "none"
OTEL_LOGS_EXPORTER: "none"
VALKEY_URL: "redis://valkey"
AWS_ACCESS_KEY_ID: access_key
AWS_SECRET_ACCESS_KEY: secret_key
AWS_ENDPOINT_URL_S3: http://s3:9900
BUCKET_NAME: osrd
restart: "no"
command: "true"
editoast:
image: ghcr.io/openrailassociation/osrd-${RELEASE_CHANNEL-edge}/osrd-editoast:${TAG-dev}
container_name: osrd-editoast
depends_on:
postgres: { condition: service_healthy }
valkey: { condition: service_healthy }
rabbitmq: { condition: service_healthy }
openfga: { condition: service_started }
build:
context: editoast
dockerfile: Dockerfile
additional_contexts:
test_data: tests/data
static_assets: assets
args:
CARGO_PROFILE: dev
OSRD_GIT_DESCRIBE: development
restart: unless-stopped
ports: [ "8090:80" ]
environment:
EDITOAST_PORT: 80
ROOT_URL: "http://localhost:4000/api"
VALKEY_URL: "redis://valkey"
DATABASE_URL: "postgres://osrd:password@postgres/osrd"
OSRDYNE_API_URL: "http://osrdyne:4242/"
TELEMETRY_KIND: "none"
TELEMETRY_ENDPOINT: "http://jaeger:4317"
OSRD_MQ_URL: "amqp://osrd:password@rabbitmq:5672/%2f"
FGA_API_URL: "http://openfga:8091"
EDITOAST_ENABLE_AUTHORIZATION: ${EDITOAST_ENABLE_AUTHORIZATION:-true}
EDITOAST_NO_CACHE: ${EDITOAST_NO_CACHE:-false}
command: >
/bin/sh -c "
fga_migrations apply &&
diesel migration run --locked-schema &&
editoast user add 'Example User' 'mock/mocked' &&
editoast roles add 'mock/mocked' Admin &&
exec editoast runserver"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost/health" ]
start_period: 4s
interval: 5s
retries: 6
gateway:
image: ghcr.io/openrailassociation/osrd-${RELEASE_CHANNEL-edge}/osrd-gateway:${TAG-dev}-${GATEWAY_FLAVOR-front}
container_name: osrd-gateway
build:
context: gateway
dockerfile: Dockerfile
args:
OSRD_GIT_DESCRIBE: development
CARGO_PROFILE: dev
additional_contexts:
front_src: front
restart: unless-stopped
ports: [ "4000:4000" ]
osrdyne:
image: ghcr.io/openrailassociation/osrd-${RELEASE_CHANNEL-edge}/osrd-osrdyne:${TAG-dev}
container_name: osrd-osrdyne
depends_on:
rabbitmq: { condition: service_healthy }
s3_init: { condition: service_completed_successfully }
command: osrdyne
volumes:
- ${DOCKER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock
- ./docker/osrdyne.yml:/osrdyne.yml
build:
context: osrdyne
dockerfile: Dockerfile
args:
CARGO_PROFILE: dev
restart: unless-stopped
ports: [ "4242:4242" ]
environment:
RUST_LOG: "info"
OSRDYNE__OPENTELEMETRY__ENDPOINT: "http://jaeger:4317"
OSRDYNE__WORKER_DRIVER__WORKER_IMAGE: "ghcr.io/openrailassociation/osrd-${RELEASE_CHANNEL-edge}/osrd-core:${TAG-dev}"
jaeger:
image: jaegertracing/jaeger:latest
container_name: osrd-jaeger
profiles:
- telemetry
restart: unless-stopped
ports:
- "4317:4317"
- "4318:4318"
- "16686:16686"
wait-healthy:
depends_on:
editoast: { condition: service_healthy }
restart: "no"
image: alpine:latest
command: "true"