-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
80 lines (78 loc) · 3.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
80 lines (78 loc) · 3.5 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
services:
app:
build:
context: .
# Match the container user to the host user so files written into the
# bind mount below are not root-owned. Set UID/GID in .env -- see
# .env.example. Changing these needs a rebuild AND `docker compose down
# -v`, because the anonymous node_modules volume keeps the ownership it
# was first created with.
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
ports:
- '4200:4200'
- '4001:4001'
volumes:
- .:/app
- /app/node_modules
# This ensures the nested tina folder is visible to the watcher
- ./projects/website-angular/tina:/app/projects/website-angular/tina
# localhost inside a container is the container. The Reactome backend
# (Tomcat, and behind it Neo4j and Solr) runs on the host, so reach it
# through the docker bridge gateway. proxy.conf.js reads this and otherwise
# defaults to localhost:8080, which is correct when running on the host.
extra_hosts:
- 'host.docker.internal:host-gateway'
environment:
- NG_CLI_ANALYTICS=false
- NODE_ENV=development
- REACTOME_BACKEND=http://host.docker.internal:8080
# The render service is a sibling container, not loopback. proxy.conf.js
# reads this and otherwise defaults to 127.0.0.1:4310, which is correct
# when both run on the host.
- RENDER_TARGET=http://render:4310
stdin_open: true
tty: true
# Diagram figures for documents -- GIF, PPTX, PDF, PNG, SVG -- rendered by
# driving the app's own render page, so an exported figure cannot drift from
# what a curator sees. Replaces the Java exporters, which reimplement the
# drawing.
render:
build:
context: .
dockerfile: deploy/render-service/Dockerfile
# A render is a browser holding a large canvas, and this box also runs the
# site, Tomcat and Neo4j. If it wedges or runs out of memory, restarting is
# the right response -- there is no state to lose but the cache, which is on
# a volume.
restart: unless-stopped
# Loopback only, never 0.0.0.0. The site's own origin proxies /RenderService
# to this, so a render can only be commissioned through whatever fronts the
# site -- crawlers on the old /ContentService/exporter/* URLs are what
# exhausted Tomcat's heap and took the origin down. Publishing it here rather
# than relying on the compose network because on the dev box the site itself
# runs on the host, not in compose; a deployment where both are containers can
# drop this line and reach it by service name.
ports:
- '127.0.0.1:4310:4310'
environment:
# What it renders. The service name when the site is a container here, the
# host when it is not -- which is the case on the dev box.
- RENDER_BASE=${RENDER_BASE:-http://host.docker.internal:4200}
- RENDER_CACHE=/cache
- RENDER_CONCURRENCY=2
- RENDER_QUEUE=8
volumes:
- render-cache:/cache
# No depends_on: the site it renders may be the app service or may be on the
# host, and starting a second app container would fight the first for :4200.
extra_hosts:
- 'host.docker.internal:host-gateway'
# Chromium's default 64 MB /dev/shm is not enough for a 6000px canvas; a
# renderer that fails only on large diagrams is the usual symptom.
shm_size: '1gb'
volumes:
# Survives a container replacement, which is the point: a cached figure is a
# file read, and rebuilding the cache means paying for every render again.
render-cache: