-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathdocker-compose.yml
147 lines (140 loc) · 3.89 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
version: '3'
volumes:
psql_data:
redis_data:
services:
postgres:
image: postgis/postgis:13-3.2-alpine
container_name: osrd-postgres
network_mode: host
user: postgres
restart: unless-stopped
environment:
POSTGRES_PASSWORD: "password"
volumes:
- "psql_data:/var/lib/postgresql/data"
- "./init_db.sql:/docker-entrypoint-initdb.d/init.sql"
healthcheck:
test: ["CMD", "sh", "-c", '[ "$$(cat /proc/1/cmdline)" = postgres ] && pg_isready']
start_period: 4s
interval: 5s
redis:
image: redis
container_name: osrd-redis
network_mode: host
restart: unless-stopped
volumes:
- "redis_data:/data"
command: "redis-server --save 30 1 --loglevel warning"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
start_period: 4s
interval: 5s
chartos:
image: osrd/chartos
container_name: osrd-chartos
network_mode: host
build:
context: chartos
dockerfile: Dockerfile
depends_on:
postgres: {condition: service_healthy}
redis: {condition: service_healthy}
restart: unless-stopped
command: "uvicorn --factory chartos:make_app --host 0.0.0.0 --port 7070"
environment:
ROOT_URL: "http://localhost:7070"
CONFIG_PATH: "/code/chartos.yml"
PSQL_DSN: "postgres://osrd:password@localhost:5432/osrd"
REDIS_URL: "redis://localhost:6379"
healthcheck:
test: ["CMD", "python", "-c", "from urllib.request import urlopen; exit(0 if urlopen('http://localhost:7070/health/').status == 200 else 1)"]
start_period: 4s
interval: 5s
api:
image: osrd/api
container_name: osrd-api
network_mode: host
depends_on:
postgres: {condition: service_healthy}
restart: unless-stopped
build:
context: api
dockerfile: Dockerfile
args:
environment: test
environment:
OSRD_DEV: "True"
OSRD_BACKEND_URL: "http://localhost:8080"
command:
- /bin/sh
- -c
- |
set -e
python3 manage.py migrate
exec python3 manage.py runserver 0.0.0.0:8000
# bind the code inside the container
volumes:
- ./api:/home/service
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health/"]
start_period: 4s
interval: 5s
core:
image: osrd/core
container_name: osrd-core
network_mode: host
build:
context: core
dockerfile: Dockerfile
restart: unless-stopped
command: "java -ea -jar /app/osrd_core.jar api -p 8080"
environment:
MIDDLEWARE_BASE_URL: "http://localhost:8000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
start_period: 4s
interval: 5s
front:
image: osrd/front
container_name: osrd-front
build:
context: front
dockerfile: Dockerfile
args:
NGINX_CONFIG: "nginx-dev.conf"
REACT_APP_LOCAL_BACKEND: "True"
REACT_APP_API_URL: "http://localhost:8000"
REACT_APP_CHARTIS_URL: "http://localhost:7070"
REACT_APP_EDITOAST_URL: "http://localhost:8090"
restart: unless-stopped
ports: ["3000:80"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
start_period: 4s
interval: 5s
editoast:
image: osrd/editoast
container_name: osrd-editoast
network_mode: host
depends_on:
postgres: {condition: service_healthy}
chartos: {condition: service_healthy}
build:
context: editoast
dockerfile: Dockerfile
restart: unless-stopped
environment:
ROCKET_PROFILE: debug
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8090/health"]
start_period: 4s
interval: 5s
wait-healthy:
depends_on:
api: {condition: service_healthy}
chartos: {condition: service_healthy}
editoast: {condition: service_healthy}
restart: "no"
image: alpine:latest
command: "true"