Skip to content

Commit d453105

Browse files
authored
Merge pull request DSpace#2966 from tdonohue/update_backend_docker_scripts
Update REST and CI docker compose scripts to sync with 8.0 backend
2 parents 6d582cd + e13f35e commit d453105

3 files changed

Lines changed: 31 additions & 17 deletions

File tree

docker/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ the Docker compose scripts in this 'docker' folder.
2020

2121
### Dockerfile
2222

23-
This Dockerfile is used to build a *development* DSpace 7 Angular UI image, published as 'dspace/dspace-angular'
23+
This Dockerfile is used to build a *development* DSpace Angular UI image, published as 'dspace/dspace-angular'
2424

2525
```
2626
docker build -t dspace/dspace-angular:latest .
@@ -46,11 +46,11 @@ A default/demo version of this image is built *automatically*.
4646

4747
## 'docker' directory
4848
- docker-compose.yml
49-
- Starts DSpace Angular with Docker Compose from the current branch. This file assumes that a DSpace 7 REST instance will also be started in Docker.
49+
- Starts DSpace Angular with Docker Compose from the current branch. This file assumes that a DSpace REST instance will also be started in Docker.
5050
- docker-compose-rest.yml
51-
- Runs a published instance of the DSpace 7 REST API - persists data in Docker volumes
51+
- Runs a published instance of the DSpace REST API - persists data in Docker volumes
5252
- docker-compose-ci.yml
53-
- Runs a published instance of the DSpace 7 REST API for CI testing. The database is re-populated from a SQL dump on each startup.
53+
- Runs a published instance of the DSpace REST API for CI testing. The database is re-populated from a SQL dump on each startup.
5454
- cli.yml
5555
- Docker compose file that provides a DSpace CLI container to work with a running DSpace REST container.
5656
- cli.assetstore.yml
@@ -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 d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d
74+
docker-compose -p d8 -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 d7 up -d
89+
docker-compose -p d8 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 d7 -f docker/docker-compose.yml up -d
96+
docker-compose -p d8 -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 d7 -f docker/docker-compose-dist.yml up -d
110+
docker-compose -p d8 -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 d7 -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 d8 -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 d7 -f docker/cli.yml -f ./docker/cli.ingest.yml run --rm dspace-cli
122+
docker-compose -p d8 -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 with Database Content from a database dump
129129
```
130-
docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f docker/db.entities.yml up -d
130+
docker-compose -p d8 -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 d7 -f docker/cli.yml -f docker/cli.assetstore.yml run --rm dspace-cli
135+
docker-compose -p d8 -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 d7ci -f docker/docker-compose-ci.yml up -d
143+
docker-compose -p d8ci -f docker/docker-compose-ci.yml up -d
144144
```

docker/docker-compose-ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ services:
3333
# Tell Statistics to commit all views immediately instead of waiting on Solr's autocommit.
3434
# This allows us to generate statistics in e2e tests so that statistics pages can be tested thoroughly.
3535
solr__D__statistics__P__autoCommit: 'false'
36+
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
3637
image: "${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
3738
depends_on:
3839
- dspacedb
@@ -60,15 +61,19 @@ services:
6061
# NOTE: This is customized to use our loadsql image, so that we are using a database with existing test data
6162
dspacedb:
6263
container_name: dspacedb
64+
image: "${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest-loadsql}"
6365
environment:
6466
# This LOADSQL should be kept in sync with the LOADSQL in
6567
# https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/db.entities.yml
6668
# This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
6769
LOADSQL: https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-data.sql
6870
PGDATA: /pgdata
69-
image: dspace/dspace-postgres-pgcrypto:loadsql
71+
POSTGRES_PASSWORD: dspace
7072
networks:
7173
- dspacenet
74+
ports:
75+
- published: 5432
76+
target: 5432
7277
stdin_open: true
7378
tty: true
7479
volumes:
@@ -105,6 +110,8 @@ services:
105110
cp -r /opt/solr/server/solr/configsets/statistics/* statistics
106111
precreate-core qaevent /opt/solr/server/solr/configsets/qaevent
107112
cp -r /opt/solr/server/solr/configsets/qaevent/* qaevent
113+
precreate-core suggestion /opt/solr/server/solr/configsets/suggestion
114+
cp -r /opt/solr/server/solr/configsets/suggestion/* suggestion
108115
exec solr -f
109116
volumes:
110117
assetstore:

docker/docker-compose-rest.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ services:
2929
# __D__ => "-" (e.g. google__D__metadata => google-metadata)
3030
# dspace.dir, dspace.server.url, dspace.ui.url and dspace.name
3131
dspace__P__dir: /dspace
32-
dspace__P__server__P__url: http://localhost:8080/server
33-
dspace__P__ui__P__url: http://localhost:4000
32+
# Uncomment to set a non-default value for dspace.server.url or dspace.ui.url
33+
# dspace__P__server__P__url: http://localhost:8080/server
34+
# dspace__P__ui__P__url: http://localhost:4000
3435
dspace__P__name: 'DSpace Started with Docker Compose'
3536
# db.url: Ensure we are using the 'dspacedb' image for our database
3637
db__P__url: 'jdbc:postgresql://dspacedb:5432/dspace'
@@ -39,6 +40,7 @@ services:
3940
# proxies.trusted.ipranges: This setting is required for a REST API running in Docker to trust requests
4041
# from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above.
4142
proxies__P__trusted__P__ipranges: '172.23.0'
43+
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
4244
image: "${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
4345
depends_on:
4446
- dspacedb
@@ -50,6 +52,7 @@ services:
5052
stdin_open: true
5153
tty: true
5254
volumes:
55+
# Keep DSpace assetstore directory between reboots
5356
- assetstore:/dspace/assetstore
5457
# Ensure that the database is ready BEFORE starting tomcat
5558
# 1. While a TCP connection to dspacedb port 5432 is not available, continue to sleep
@@ -65,9 +68,11 @@ services:
6568
# DSpace database container
6669
dspacedb:
6770
container_name: dspacedb
71+
# Uses a custom Postgres image with pgcrypto installed
72+
image: "${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}"
6873
environment:
6974
PGDATA: /pgdata
70-
image: "${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}"
75+
POSTGRES_PASSWORD: dspace
7176
networks:
7277
- dspacenet
7378
ports:
@@ -113,6 +118,8 @@ services:
113118
cp -r /opt/solr/server/solr/configsets/statistics/* statistics
114119
precreate-core qaevent /opt/solr/server/solr/configsets/qaevent
115120
cp -r /opt/solr/server/solr/configsets/qaevent/* qaevent
121+
precreate-core suggestion /opt/solr/server/solr/configsets/suggestion
122+
cp -r /opt/solr/server/solr/configsets/suggestion/* suggestion
116123
exec solr -f
117124
volumes:
118125
assetstore:

0 commit comments

Comments
 (0)