-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
186 lines (170 loc) · 6.01 KB
/
Copy pathdocker-compose.yml
File metadata and controls
186 lines (170 loc) · 6.01 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
#
# This Compose file is designed for for local development convenience. Do not
# use this configuration for production.
#
# To personalize these services for your particular environment and workflow,
# consider writing a docker-compose.override.yml file. Check out the included
# docker-compose.override.example.yml file for a starting point.
#
name: tdei-workspaces
################################################################################
x-osm-rails-base:
&osm-rails-base
build:
context: osm-rails
env_file: .env
volumes:
- ./osm-rails:/app
# Prevent these directories from mounting so they're not shared between
# host OS and Docker:
- /app/node_modules/
- osm-rails-tmp:/app/tmp
- osm-rails-storage:/app/storage
x-node-dev-base:
&node-dev-base
build:
context: node-dev
working_dir: /app
tty: true
################################################################################
services:
dev-proxy:
image: traefik:latest
ports:
- "${WS_DEV_PORT}:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
command:
- --entrypoints.web.address=:80
# The Vite dev server produces bundles with encoded paths:
- --entrypoints.web.http.encodedCharacters.allowEncodedSlash=true
- --api.insecure=true
- --log.level=INFO
- --providers.docker=true
- --providers.docker.exposedbydefault=false
labels:
- traefik.enable=true
- traefik.http.middlewares.cors.headers.accesscontrolallowmethods=*
- traefik.http.middlewares.cors.headers.accesscontrolallowheaders=*
- traefik.http.middlewares.cors.headers.accesscontrolalloworiginlist=*
- traefik.http.middlewares.cors.headers.accesscontrolmaxage=100
- traefik.http.middlewares.cors.headers.addvaryheader=true
frontend:
<<: *node-dev-base
command: run dev
environment:
VITE_TDEI_API_URL: ${WS_TDEI_API_URL}
VITE_TDEI_USER_API_URL: ${WS_TDEI_BACKEND_URL}
VITE_API_URL: ${WS_API_URL}
VITE_NEW_API_URL: ${WS_NEW_API_URL}
VITE_OSM_URL: ${WS_OSM_URL}
VITE_RAPID_URL: ${WS_RAPID_URL}
VITE_RAPID3_URL: ${WS_RAPID3_URL}
VITE_PATHWAYS_EDITOR_URL: ${WS_PATHWAYS_EDITOR_URL}
VITE_IMAGERY_SCHEMA: ${WS_IMAGERY_SCHEMA_URL}
VITE_IMAGERY_EXAMPLE_URL: ${WS_IMAGERY_EXAMPLE_URL}
VITE_LONG_FORM_QUEST_SCHEMA: ${WS_LONG_FORM_QUEST_SCHEMA_URL}
VITE_LONG_FORM_QUEST_EXAMPLE_URL: ${WS_LONG_FORM_QUEST_EXAMPLE_URL}
volumes:
- ./frontend:/app
labels:
- traefik.enable=true
- traefik.http.routers.frontend.rule=Host(`${WS_FRONTEND_HOST}`)
- traefik.http.services.frontend.loadbalancer.server.port=3000
api:
build:
context: api
environment:
PROJECT_NAME: ${WS_PLATFORM_NAME}
CORS_ORIGINS: ${WS_API_CORS_ORIGINS}
OSM_DATABASE_URL: ${WS_OSM_DB_URI}
TASK_DATABASE_URL: ${WS_TASKS_DB_URI}
TDEI_BACKEND_URL: ${WS_TDEI_BACKEND_URL}
TDEI_OIDC_URL: ${WS_TDEI_OIDC_URL}
TDEI_OIDC_REALM: ${WS_TDEI_OIDC_REALM}
SENTRY_DSN: ${WS_API_SENTRY_DSN}
LONGFORM_SCHEMA_URL: ${WS_LONG_FORM_QUEST_SCHEMA_URL}
IMAGERY_SCHEMA_URL: ${WS_IMAGERY_SCHEMA_URL}
volumes:
- ./api:/app
labels:
- traefik.enable=true
# api container also serves the legacy workspaces backend host (was tasks-backend) and the OSM host
- traefik.http.routers.api.rule=Host(`${WS_NEW_API_HOST}`) || Host(`${WS_API_HOST}`) || Host(`${WS_OSM_HOST}`)
- traefik.http.services.api.loadbalancer.server.port=8000
rapid:
<<: *node-dev-base
command: run start
volumes:
- ./rapid:/app
labels:
- traefik.enable=true
- traefik.http.routers.rapid.rule=Host(`${WS_RAPID_HOST}`)
- traefik.http.routers.rapid.middlewares=cors
- traefik.http.services.rapid.loadbalancer.server.port=8080
pathways-editor:
<<: *node-dev-base
command: run start
volumes:
- ./pathways-editor:/app
labels:
- traefik.enable=true
- traefik.http.routers.pathways-editor.rule=Host(`${WS_PATHWAYS_EDITOR_HOST}`)
- traefik.http.routers.pathways-editor.middlewares=cors
- traefik.http.services.pathways-editor.loadbalancer.server.port=8080
osm-log-proxy:
image: nginx:latest
volumes:
- ./nginx.debug.conf:/etc/nginx/nginx.conf:ro
depends_on:
- osm-web
# WS_OSM_HOST is served by the api container (proxied to osm-web); leave this un-routed
# labels:
# - traefik.enable=true
# - traefik.http.routers.osm-log-proxy.rule=Host(`${WS_OSM_HOST}`)
# - traefik.http.services.osm-log-proxy.loadbalancer.server.port=80
osm-web:
image: nginx:stable-alpine
depends_on:
- osm-rails
- osm-cgimap
sysctls:
net.core.somaxconn: 4096
volumes:
- ./osm-web/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./osm-rails/public:/usr/share/nginx/html:ro
# FRONTED BY osm-log-proxy IN DEV (osm-log-proxy serves WS_OSM_HOST and proxies here)
# labels:
# - traefik.enable=true
# - traefik.http.routers.osm-web.rule=Host(`${WS_OSM_HOST}`)
# - traefik.http.services.osm-web.loadbalancer.server.port=80
osm-rails:
<<: *osm-rails-base
command: bundle exec rails s -p 3000 -b '0.0.0.0'
environment:
PIDFILE: /tmp/pids/server.pid
tmpfs: /tmp/pids/
osm-rails-worker:
<<: *osm-rails-base
command: bundle exec rake jobs:work
osm-cgimap:
build:
context: osm-cgimap
dockerfile: docker/ubuntu/Dockerfile2404
sysctls:
net.core.somaxconn: 4096
net.ipv4.tcp_max_syn_backlog: 4096
environment:
CGIMAP_INSTANCES: ${WS_CGIMAP_INSTANCES}
CGIMAP_HOST: ${WS_OSM_DB_HOST}
CGIMAP_USERNAME: ${WS_OSM_DB_USER}
CGIMAP_PASSWORD: ${WS_OSM_DB_PASS}
CGIMAP_DBNAME: ${WS_OSM_DB_NAME}
CGIMAP_MAX_CHANGESET_ELEMENTS: ${WS_OSM_MAX_CHANGESET_ELEMENTS}
CGIMAP_MAX_PAYLOAD: ${WS_OSM_MAX_UPLOAD_BYTES}
CGIMAP_MAP_NODES: ${WS_OSM_MAX_EXPORT_NODES}
CGIMAP_MAP_AREA: ${WS_OSM_MAX_EXPORT_AREA}
volumes:
osm-rails-tmp:
osm-rails-storage:
osm-rails-db-data: