forked from DSpace/DSpace
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose-angular.yml
More file actions
66 lines (65 loc) · 2.71 KB
/
Copy pathdocker-compose-angular.yml
File metadata and controls
66 lines (65 loc) · 2.71 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
#
# The contents of this file are subject to the license and copyright
# detailed in the LICENSE and NOTICE files at the root of the source
# tree and available online at
#
# http://www.dspace.org/license/
#
networks:
# Default to using network named 'dspacenet' from docker-compose.yml.
# Its full name will be prepended with the project name (e.g. "-p d7" means it will be named "d7_dspacenet")
default:
name: ${COMPOSE_PROJECT_NAME}_dspacenet
external: true
services:
dspace-angular:
container_name: dspace-angular
restart: unless-stopped
depends_on:
dspace:
condition: service_healthy
environment:
DSPACE_UI_SSL: 'false'
DSPACE_UI_HOST: dspace-angular
DSPACE_UI_PORT: '4000'
DSPACE_UI_NAMESPACE: /
DSPACE_REST_SSL: 'false'
DSPACE_REST_HOST: localhost
DSPACE_REST_PORT: 8080
DSPACE_REST_NAMESPACE: /server
image: "${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-dspace-7.6.5}"
ports:
- published: 4000
target: 4000
- published: 9876
target: 9876
stdin_open: true
tty: true
# Probe choice, and why it is not the obvious one:
#
# NOT /app/health - that endpoint is a pure proxy to the backend actuator (see
# server.ts healthCheck()), so it reports the BACKEND's health, not this
# container's. It would mark the UI unhealthy whenever the backend is down, and
# restarting the UI cannot fix the backend, so autoheal would loop. It also
# forwards the backend's HTTP 200-on-DOWN.
#
# NOT /robots.txt either - that express route lives in the SSR server (server.ts)
# which only runs in the *dist* image. This overlay uses dspace/dspace-angular,
# the DEVELOPMENT image: it runs `ng serve`, which returns 404 for /robots.txt.
# Measured on this image: / -> 200 in 35ms, /robots.txt -> 404.
# If you switch this overlay to dspace-angular-dist, /robots.txt becomes the
# better probe - it is served from a template with no backend call.
#
# start_period is large on purpose: `ng serve` compiles the bundles at container
# start and does not answer the first request for many minutes. A short value here
# means autoheal kills the build and the container never finishes booting - we hit
# exactly that during testing.
healthcheck:
test: ["CMD-SHELL", "node -e \"const r=require('http').get({host:'127.0.0.1',port:4000,path:'/'},s=>process.exit(s.statusCode===200?0:1));r.setTimeout(8000,()=>{r.destroy();process.exit(1)});r.on('error',()=>process.exit(1))\""]
interval: 30s
timeout: 10s
retries: 3
start_period: 900s
labels:
# Consumed by the optional autoheal sidecar, see docker-compose-autoheal.yml
autoheal: "true"