-
Notifications
You must be signed in to change notification settings - Fork 44
/
docker-compose.yml
200 lines (188 loc) · 5.72 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
199
200
volumes:
psql_data:
valkey_data:
rabbitmq_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
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
core:
# This is a dummy container to build the core image
# and document/provide parameters to other compose files
image: ghcr.io/openrailassociation/osrd-edge/osrd-core:${TAG-dev}
container_name: osrd-core-dummy
depends_on:
rabbitmq: { condition: service_healthy }
build:
context: core
dockerfile: Dockerfile
additional_contexts:
test_data: tests/data
static_assets: assets
environment:
# Actual values in ./docker/osrdyne.yml (please maintain consistency)
# Provided here only for reuse in compose layers and doc
CORE_EDITOAST_URL: "http://osrd-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"
restart: "no"
command: "true"
front:
image: ghcr.io/openrailassociation/osrd-edge/osrd-front:${TAG-dev}-${OSRD_FRONT_MODE-devel}
container_name: osrd-front
build:
context: front
additional_contexts:
test_data: tests/data
dockerfile: docker/Dockerfile.${OSRD_FRONT_MODE-devel}
args:
OSRD_GIT_DESCRIBE: ${OSRD_GIT_DESCRIBE}
environment:
FRONT_PORT: 3000 # only useful with the prod config
OSRD_EDITOAST_URL: /api
volumes:
- "./front:/app"
- "./tests/data:/tests/data"
restart: unless-stopped
ports: [ "3000:3000" ]
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:3000" ]
start_period: 4s
interval: 5s
retries: 6
editoast:
image: ghcr.io/openrailassociation/osrd-edge/osrd-editoast:${TAG-dev}
container_name: osrd-editoast
depends_on:
postgres: { condition: service_healthy }
valkey: { condition: service_healthy }
rabbitmq: { condition: service_healthy }
build:
context: editoast
dockerfile: Dockerfile
additional_contexts:
test_data: tests/data
static_assets: assets
args:
CARGO_PROFILE: dev
restart: unless-stopped
ports: [ "8090:80" ]
environment:
EDITOAST_PORT: 80
VALKEY_URL: "redis://valkey"
DATABASE_URL: "postgres://osrd:password@postgres/osrd"
OSRDYNE_API_URL: "http://osrd-osrdyne:4242/"
TELEMETRY_KIND: "opentelemetry"
TELEMETRY_ENDPOINT: "http://jaeger:4317"
OSRD_MQ_URL: "amqp://osrd:password@osrd-rabbitmq:5672/%2f"
command:
- /bin/sh
- -c
- "diesel migration run && exec editoast runserver"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost/health" ]
start_period: 4s
interval: 5s
retries: 6
gateway:
image: ghcr.io/openrailassociation/osrd-edge/osrd-gateway:${TAG-dev}-standalone
container_name: osrd-gateway
build:
context: gateway
dockerfile: Dockerfile
args:
OSRD_GIT_DESCRIBE: ${OSRD_GIT_DESCRIBE}
CARGO_PROFILE: dev
volumes:
- "./docker/gateway.dev.simple.toml:/gateway.toml"
restart: unless-stopped
ports: [ "4000:4000" ]
osrd-images:
image: ghcr.io/openrailassociation/osrd-stable/osrd-images:${TAG_IMAGES-v1.0.0}
container_name: osrd-images
restart: unless-stopped
environment:
- NGINX_PORT=8080
ports: [ "8080:8080" ]
osrdyne:
image: ghcr.io/openrailassociation/osrd-edge/osrd-osrdyne:${TAG-dev}
container_name: osrd-osrdyne
depends_on:
rabbitmq: { condition: service_healthy }
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://osrd-jaeger:4317"
OSRDYNE__OPENTELEMETRY__SERVICE_NAME: "osrdyne"
jaeger:
image: jaegertracing/all-in-one:latest
container_name: osrd-jaeger
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"