Skip to content

Commit 325b029

Browse files
committed
WIP rebase onto upstream/clarin-v7: move customizations out of upstream files
Parks rebased work on a branch. Login is broken and needs investigation — do not merge to clarin-dk-v7 until root-caused. Restructured to keep upstream-tracked files (Dockerfile, docker-compose.yml) byte-identical with upstream/clarin-v7. All CLARIN-DK deltas now live in files we own: - docker/docker-compose.frontend.override.yml (new) — frontend compose deltas: * build with Dockerfile.dist (matches upstream's intended build path; the pm2 config lands at /app/dspace-ui.json, where upstream's compose entrypoint looks after ufal/dspace-angular#1060) * mem_limit: 2g (SSR leak cap; previously in docker-compose.yml) * DSPACE_UI_HOST=0.0.0.0 (upstream hard-codes the docker-network hostname, which doesn't fit our nginx-on-host reverse-proxy layout) * DSPACE_REST_PORT=443 (upstream defaults to :8080 which only works inside the docker network; we reach the backend via nginx at HTTPS :443) - Dockerfile: restored to upstream (dropped our yarn-install caching split; no longer used since we build with Dockerfile.dist) - docker/docker-compose.yml: restored to upstream (mem_limit and env defaults moved to the frontend override file) Frontend compose invocation now requires the extra -f flag: docker compose -f docker-compose.yml -f docker-compose.frontend.override.yml up -d --build README still documents the old single-file invocation — update before merging. Known broken: login flow after this rebase. Backend unchanged, so the cause is likely in the upstream frontend commits (137 of them) or in an interaction with our Shibboleth/DiscoJuice customizations under src/aai/.
1 parent 52b06f5 commit 325b029

3 files changed

Lines changed: 24 additions & 15 deletions

File tree

Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@ FROM docker.io/node:18-alpine
88
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*
99

1010
WORKDIR /app
11+
ADD . /app/
12+
EXPOSE 4000
1113

12-
# Copy dependency manifests first so that yarn install is cached as long as deps don't change
13-
COPY package.json yarn.lock ./
1414
# We run yarn install with an increased network timeout (5min) to avoid "ESOCKETTIMEDOUT" errors from hub.docker.com
1515
# See, for example https://github.com/yarnpkg/yarn/issues/5540
1616
RUN yarn install --network-timeout 300000
1717

18-
COPY . ./
19-
EXPOSE 4000
20-
2118
# When running in dev mode, 4GB of memory is required to build & launch the app.
2219
# This default setting can be overridden as needed in your shell, via an env file or in docker-compose.
2320
# See Docker environment var precedence: https://docs.docker.com/compose/environment-variables/envvars-precedence/
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# CLARIN-DK frontend overrides. Merged on top of docker-compose.yml via:
2+
# docker compose -f docker-compose.yml -f docker-compose.frontend.override.yml up -d --build
3+
# Keeps upstream's docker-compose.yml byte-identical.
4+
services:
5+
dspace-angular:
6+
# Use upstream's multi-stage "dist" Dockerfile — it's what upstream's entrypoint
7+
# assumes (places dspace-ui.json at /app/dspace-ui.json). The plain Dockerfile
8+
# puts the file at /app/docker/dspace-ui.json and no longer matches.
9+
build:
10+
dockerfile: Dockerfile.dist
11+
# Cap SSR memory leak; pm2-runtime respawns the worker on OOM.
12+
# TODO: investigate and fix the underlying SSR leak so this cap is no longer load-bearing.
13+
mem_limit: 2g
14+
environment:
15+
# Listen on all interfaces in-container; nginx on the host reverse-proxies to 4001.
16+
# Upstream hard-codes the docker-network hostname, which doesn't fit our nginx layout.
17+
DSPACE_UI_HOST: '0.0.0.0'
18+
# REST backend is reached via nginx at HTTPS :443, not directly at :8080.
19+
# Upstream's default is 8080 which only makes sense inside the docker network.
20+
DSPACE_REST_PORT: 443

docker/docker-compose.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,16 @@ services:
1515
dspace-angular:
1616
restart: unless-stopped
1717
container_name: dspace-angular${INSTANCE}
18-
# Cap SSR memory leak; pm2-runtime respawns the worker on OOM.
19-
# TODO: investigate and fix the underlying SSR memory leak so this cap is no longer load-bearing.
20-
# TODO: revisit memory tuning for the other services — consider reducing the dspace -Xmx and
21-
# solr -m defaults (currently 4g each in docker-compose-rest.yml) and/or adding analogous
22-
# mem_limit caps on dspace and dspacesolr.
23-
mem_limit: 2g
2418
environment:
2519
TZ: ${TIMEZONE:-Europe/Bratislava}
26-
# UI runs plain HTTP on 0.0.0.0 inside container - nginx handles SSL termination
2720
DSPACE_UI_SSL: 'false'
28-
DSPACE_UI_HOST: '0.0.0.0'
21+
DSPACE_UI_HOST: dspace-angular
2922
# Use only `4000`, not the {UI_PORT} from the .env because in the container it is always `4000`
3023
DSPACE_UI_PORT: 4000
3124
DSPACE_UI_NAMESPACE: ${DSPACE_UI_NAMESPACE:-/}
32-
# REST uses HTTPS since we call the external URL via nginx
3325
DSPACE_REST_SSL: ${DSPACE_SSL:-false}
3426
DSPACE_REST_HOST: ${DSPACE_HOST:-localhost}
35-
DSPACE_REST_PORT: ${DSPACE_REST_PORT:-443}
27+
DSPACE_REST_PORT: ${DSPACE_REST_PORT:-8080}
3628
DSPACE_REST_NAMESPACE: ${DSPACE_REST_NAMESPACE:-/server}
3729
image: ${DSPACE_UI_IMAGE:-ufal/dspace-angular:dspace-7_x}
3830
volumes:

0 commit comments

Comments
 (0)