Skip to content

Commit 3ec019d

Browse files
committed
[DSC-2193] Change configuration to push DSpace-CRIS images to 4Science dockerhub
1 parent 8cfaf31 commit 3ec019d

11 files changed

Lines changed: 72 additions & 49 deletions

.github/workflows/docker.yml

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,66 @@ name: Docker images
99
on:
1010
push:
1111
branches:
12-
- main
13-
- 'dspace-**'
12+
- main-cris
13+
- 'dspace-cris-**'
1414
tags:
15-
- 'dspace-**'
15+
- 'dspace-cris-*.*.*'
1616
pull_request:
1717

1818
permissions:
1919
contents: read # to fetch code (actions/checkout)
2020
packages: write # to write images to GitHub Container Registry (GHCR)
2121

2222
jobs:
23+
24+
####################################################
25+
# Build/Push the '4science/dspace-cris-dependencies' image.
26+
# This image is used by all other DSpace build jobs.
27+
####################################################
28+
dspace-cris-angular-dependencies:
29+
# Ensure this job never runs on forked repos. It's only executed for '4science/dspace'
30+
if: github.repository == '4science/dspace-angular'
31+
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
32+
uses: 4science/DSpace/.github/workflows/reusable-docker-build.yml@dspace-cris-2024_02_x
33+
with:
34+
build_id: dspace-cris-angular-dependencies
35+
image_name: 4science/dspace-cris-angular-dependencies
36+
dockerfile_path: ./Dockerfile.dependencies
37+
secrets:
38+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
39+
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
40+
41+
2342
#############################################################
24-
# Build/Push the 'dspace/dspace-angular' image
43+
# Build/Push the '4science/dspace-cris-angular' image
2544
#############################################################
2645
dspace-angular:
2746
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
28-
if: github.repository == 'dspace/dspace-angular'
47+
if: github.repository == '4science/dspace-angular'
2948
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
30-
uses: DSpace/DSpace/.github/workflows/reusable-docker-build.yml@main
49+
uses: 4science/DSpace/.github/workflows/reusable-docker-build.yml@dspace-cris-2024_02_x
50+
needs: dspace-cris-angular-dependencies
3151
with:
32-
build_id: dspace-angular-dev
33-
image_name: dspace/dspace-angular
52+
build_id: dspace-cris-angular-dev
53+
image_name: 4science/dspace-cris-angular
3454
dockerfile_path: ./Dockerfile
3555
secrets:
3656
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
3757
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
3858

3959
#############################################################
40-
# Build/Push the 'dspace/dspace-angular' image ('-dist' tag)
60+
# Build/Push the '4science/dspace-cris-angular' image ('-dist' tag)
4161
#############################################################
4262
dspace-angular-dist:
4363
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
44-
if: github.repository == 'dspace/dspace-angular'
64+
if: github.repository == '4science/dspace-angular'
4565
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
46-
uses: DSpace/DSpace/.github/workflows/reusable-docker-build.yml@main
66+
uses: 4science/DSpace/.github/workflows/reusable-docker-build.yml@dspace-cris-2024_02_x
67+
# Must run after 'dspace-dependencies' job above
68+
needs: dspace-cris-angular-dependencies
4769
with:
48-
build_id: dspace-angular-dist
49-
image_name: dspace/dspace-angular
70+
build_id: dspace-cris-angular-dist
71+
image_name: 4science/dspace-cris-angular
5072
dockerfile_path: ./Dockerfile.dist
5173
# As this is a "dist" image, its tags are all suffixed with "-dist". Otherwise, it uses the same
5274
# tagging logic as the primary 'dspace/dspace-angular' image above.

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
33

44
ARG NODE_VERSION=22
5-
ARG DSPACE_VERSION=2024_02_x
5+
ARG DSPACE_VERSION=dspace-cris-2024_02_x
66
ARG DOCKER_REGISTRY=docker.io
77

8-
FROM ${DOCKER_REGISTRY:-docker.io}/4science/dspace-cris-angular-dependencies:${DSPACE_VERSION:-2024_02_x} AS dev
8+
FROM ${DOCKER_REGISTRY:-docker.io}/4science/dspace-cris-angular-dependencies:${DSPACE_VERSION:-dspace-cris-2024_02_x} AS dev
99

1010
WORKDIR /app
1111
ADD . /app/

Dockerfile.dependencies

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Test build:
2-
# docker build -f Dockerfile.dependencies -t 4science/dspace-angular-dependencies:2024_02_x .
2+
# docker build -f Dockerfile.dependencies -t 4science/dspace-cris-angular-dependencies:dspace-cris-2024_02_x .
33

44
# Angular 17 + Node 22 optimized Dockerfile
55
ARG NODE_VERSION=22
6-
ARG DSPACE_VERSION=2024_02_X
6+
ARG DSPACE_VERSION=dspace-cris-2024_02_x
77
ARG DOCKER_REGISTRY=docker.io
88

9-
FROM ${DOCKER_REGISTRY:-docker.io}/node:${NODE_VERSION-22}-alpine AS dependencies
9+
FROM docker.io/node:${NODE_VERSION-22}-alpine AS dependencies
1010

1111
# Install build dependencies
1212
RUN apk add --no-cache python3 make g++
@@ -15,4 +15,4 @@ WORKDIR /app
1515

1616
# Install dependencies (use npm ci if you have package-lock.json)
1717
COPY package.json yarn.lock ./
18-
RUN yarn install --network-timeout 300000
18+
RUN yarn install --frozen-lockfile --network-timeout 300000

Dockerfile.dist

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
# syntax=docker/dockerfile:1.7-labs
22

33
# This image will be published as dspace/dspace-angular:$DSPACE_VERSION-dist
4-
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
4+
# See https://github.com/4science/dspace-angular/tree/main/docker for usage details
55

66
# Test build:
7-
# docker build -f Dockerfile.dist -t dspace/dspace-angular:dspace-8_x-dist .
7+
# docker build -f Dockerfile.dist -t 4science/dspace-angular:dspace-cris-2024_02_x-dist .
88

99
# Angular 17 + Node 22 optimized Dockerfile
1010
ARG NODE_VERSION=22
11-
ARG DSPACE_VERSION=2024_02_x
11+
ARG DSPACE_VERSION=dspace-cris-2024_02_x
1212
ARG DOCKER_REGISTRY=docker.io
1313

14-
FROM ${DOCKER_REGISTRY:-docker.io}/4science/dspace-cris-angular-dependencies:${DSPACE_VERSION:-2024_02_x} AS build
14+
FROM ${DOCKER_REGISTRY:-docker.io}/4science/dspace-cris-angular-dependencies:${DSPACE_VERSION:-dspace-cris-2024_02_x} AS build
1515

16-
COPY --parents src/** config/** webpack/** docker/dspace-ui.json angular.json server.ts startup-message.ts tsconfig.json tsconfig.app.json tsconfig.server.json tsconfig.spec.json tsconfig.ts-node.json typedoc.json /app/
16+
COPY . /app/
1717

1818
WORKDIR /app
1919

2020
# Build Angular app
2121
RUN yarn build:prod
22+
RUN yarn build:mirador
2223

2324
# ---- Production image ----
24-
FROM ${DOCKER_REGISTRY:-docker.io}/node:${NODE_VERSION-22}-alpine AS prod
25+
FROM docker.io/node:${NODE_VERSION-22}-alpine AS prod
2526

2627
# Install pm2 globally and clean npm cache
2728
RUN npm install --global pm2 && npm cache clean --force

docker/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ the Docker compose scripts in this 'docker' folder.
2323
This Dockerfile is used to build a *development* DSpace-CRIS Angular UI image, published as '4science/dspace-cris-angular'
2424

2525
```
26-
docker build -t 4science/dspace-cris-angular:2024_02_x .
26+
docker build -t 4science/dspace-cris-angular:dspace-cris-2024_02_x .
2727
```
2828

2929
This image is built *automatically* after each commit is made to the `main` branch.
3030

3131
Admins to our DockerHub repo can manually publish with the following command.
3232
```
33-
docker push 4science/dspace-cris-angular:2024_02_x
33+
docker push 4science/dspace-cris-angular:dspace-cris-2024_02_x
3434
```
3535

3636
### Dockerfile.dist
@@ -39,7 +39,7 @@ The `Dockerfile.dist` is used to generate a *production* build and runtime envir
3939

4040
```bash
4141
# build the latest image
42-
docker build -f Dockerfile.dist -t 4science/dspace-cris-angular:2024_02_x-dist .
42+
docker build -f Dockerfile.dist -t 4science/dspace-cris-angular:dspace-cris-2024_02_x-dist .
4343
```
4444

4545
A default/demo version of this image is built *automatically*.
@@ -71,7 +71,7 @@ docker compose -f docker/docker-compose.yml build
7171

7272
This command provides a quick way to start both the frontend & backend from this single codebase
7373
```
74-
docker compose -p c24 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d
74+
docker compose -p dcris24 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d
7575
```
7676

7777
Keep in mind, you may also start the backend by cloning the 'DSpace/DSpace' GitHub repository separately. See the next section.
@@ -86,14 +86,14 @@ _The system will be started in 2 steps. Each step shares the same docker network
8686

8787
From 'DSpace/DSpace' clone (build first as needed):
8888
```
89-
docker compose -p c24 up -d
89+
docker compose -p dcris24 up -d
9090
```
9191

9292
NOTE: More detailed instructions on starting the backend via Docker can be found in the [Docker Compose instructions for the Backend](https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/README.md).
9393

9494
From 'DSpace/dspace-angular' clone (build first as needed)
9595
```
96-
docker compose -p c24 -f docker/docker-compose.yml up -d
96+
docker compose -p dcris24 -f docker/docker-compose.yml up -d
9797
```
9898

9999
At this point, you should be able to access the UI from http://localhost:4000,
@@ -107,38 +107,38 @@ This allows you to run the Angular UI in *production* mode, pointing it at the d
107107
```
108108
docker compose -f docker/docker-compose-dist.yml pull
109109
docker compose -f docker/docker-compose-dist.yml build
110-
docker compose -p c24 -f docker/docker-compose-dist.yml up -d
110+
docker compose -p dcris24 -f docker/docker-compose-dist.yml up -d
111111
```
112112

113113
## Ingest test data from AIPDIR
114114

115115
Create an administrator
116116
```
117-
docker compose -p c24 -f docker/cli.yml run --rm dspace-cli create-administrator -e test@test.edu -f admin -l user -p admin -c en
117+
docker compose -p dcris24 -f docker/cli.yml run --rm dspace-cli create-administrator -e test@test.edu -f admin -l user -p admin -c en
118118
```
119119

120120
Load content from AIP files
121121
```
122-
docker compose -p c24 -f docker/cli.yml -f ./docker/cli.ingest.yml run --rm dspace-cli
122+
docker compose -p dcris24 -f docker/cli.yml -f ./docker/cli.ingest.yml run --rm dspace-cli
123123
```
124124

125125
## Alternative Ingest - Use Entities dataset
126126
_Delete your docker volumes or use a unique project (-p) name_
127127

128128
Start DSpace-CRIS with Database Content from a database dump
129129
```
130-
docker compose -p c24 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f docker/db.entities.yml up -d
130+
docker compose -p dcris24 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f docker/db.entities.yml up -d
131131
```
132132

133133
Load assetstore content and trigger a re-index of the repository
134134
```
135-
docker compose -p c24 -f docker/cli.yml -f docker/cli.assetstore.yml run --rm dspace-cli
135+
docker compose -p dcris24 -f docker/cli.yml -f docker/cli.assetstore.yml run --rm dspace-cli
136136
```
137137

138138
## End to end testing of the REST API (runs in GitHub Actions CI).
139139
_In this instance, only the REST api runs in Docker using the Entities dataset. GitHub Actions will perform CI testing of Angular using Node to drive the tests. See `.github/workflows/build.yml` for more details._
140140

141141
This command is only really useful for testing our Continuous Integration process.
142142
```
143-
docker compose -p c24ci -f docker/docker-compose-ci.yml up -d
143+
docker compose -p dcris24ci -f docker/docker-compose-ci.yml up -d
144144
```

docker/cli.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
# Therefore, it should be kept in sync with that file
1515
networks:
1616
# Default to using network named 'dspacenet' from docker-compose-rest.yml.
17-
# Its full name will be prepended with the project name (e.g. "-p d8" means it will be named "d8_dspacenet")
17+
# Its full name will be prepended with the project name (e.g. "-p dcris24" means it will be named "dcris24_dspacenet")
1818
# If COMPOSITE_PROJECT_NAME is missing, default value will be "docker" (name of folder this file is in)
1919
default:
2020
name: ${COMPOSE_PROJECT_NAME:-docker}_dspacenet
2121
external: true
2222
services:
2323
dspace-cli:
24-
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris-cli:${DSPACE_VER:-2024_02_x}"
24+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris-cli:${DSPACE_VER:-dspace-cris-2024_02_x}"
2525
container_name: dspace-cli
2626
environment:
2727
# Below syntax may look odd, but it is how to override dspace.cfg settings via env variables.

docker/db.entities.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# # Therefore, it should be kept in sync with that file
1515
services:
1616
dspacedb:
17-
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris-postgres-pgcrypto:${DSPACE_VER:-2024_02_x}-loadsql"
17+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris-postgres-pgcrypto:${DSPACE_VER:-dspace-cris-2024_02_x}-loadsql"
1818
environment:
1919
# This LOADSQL should be kept in sync with the URL in 4Science/DSpace
2020
# This SQL is available from https://github.com/4Science/DSpace-CRIS-Files/releases/download/cris-2024.02.00/db-entities.sql

docker/docker-compose-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ services:
3333
# This allows us to generate statistics in e2e tests so that statistics pages can be tested thoroughly.
3434
solr__D__statistics__P__autoCommit: 'false'
3535
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
36-
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris:${DSPACE_VER:-2024_02_x}-test"
36+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris:${DSPACE_VER:-dspace-cris-2024_02_x}-test"
3737
depends_on:
3838
- dspacedb
3939
networks:
@@ -61,7 +61,7 @@ services:
6161
# NOTE: This is customized to use our loadsql image, so that we are using a database with existing test data
6262
dspacedb:
6363
container_name: dspacedb
64-
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris-postgres-pgcrypto:${DSPACE_VER:-2024_02_x}-loadsql"
64+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris-postgres-pgcrypto:${DSPACE_VER:-dspace-cris-2024_02_x}-loadsql"
6565
environment:
6666
# This LOADSQL should be kept in sync with the LOADSQL in
6767
# https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/db.entities.yml
@@ -83,7 +83,7 @@ services:
8383
# DSpace Solr container
8484
dspacesolr:
8585
container_name: dspacesolr
86-
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-2024_02_x}"
86+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-dspace-cris-2024_02_x}"
8787
networks:
8888
- dspacenet
8989
ports:

docker/docker-compose-dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ services:
2626
DSPACE_REST_HOST: sandbox.dspace.org
2727
DSPACE_REST_PORT: 443
2828
DSPACE_REST_NAMESPACE: /server
29-
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris-angular:${DSPACE_VER:-2024_02_x}-dist"
29+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris-angular:${DSPACE_VER:-dspace-cris-2024_02_x}-dist"
3030
build:
3131
context: ..
3232
dockerfile: Dockerfile.dist

docker/docker-compose-rest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ services:
4040
# from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above.
4141
proxies__P__trusted__P__ipranges: '172.23.0'
4242
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
43-
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris:${DSPACE_VER:-2024_02_x}-test"
43+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris:${DSPACE_VER:-dspace-cris-2024_02_x}-test"
4444
depends_on:
4545
- dspacedb
4646
networks:
@@ -68,7 +68,7 @@ services:
6868
dspacedb:
6969
container_name: dspacedb
7070
# Uses a custom Postgres image with pgcrypto installed
71-
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris-postgres-pgcrypto:${DSPACE_VER:-2024_02_x}"
71+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris-postgres-pgcrypto:${DSPACE_VER:-dspace-cris-2024_02_x}"
7272
environment:
7373
PGDATA: /pgdata
7474
POSTGRES_PASSWORD: dspace
@@ -85,7 +85,7 @@ services:
8585
# DSpace Solr container
8686
dspacesolr:
8787
container_name: dspacesolr
88-
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris-solr:${DSPACE_VER:-2024_02_x}"
88+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-4science}/dspace-cris-solr:${DSPACE_VER:-dspace-cris-2024_02_x}"
8989
networks:
9090
- dspacenet
9191
ports:

0 commit comments

Comments
 (0)