Skip to content

Commit

Permalink
Update Docker Compose scripts to resync with DSpace/DSpace
Browse files Browse the repository at this point in the history
  • Loading branch information
tdonohue committed Apr 14, 2021
1 parent f81acb5 commit 1741678
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 22 deletions.
3 changes: 2 additions & 1 deletion docker/cli.assetstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ services:
networks:
dspacenet: {}
environment:
- LOADASSETS=https://www.dropbox.com/s/v3ahfcuatklbmi0/assetstore-2019-11-28.tar.gz?dl=1
# This assetstore zip is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
- LOADASSETS=https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/assetstore.tar.gz
entrypoint:
- /bin/bash
- '-c'
Expand Down
3 changes: 2 additions & 1 deletion docker/db.entities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ services:
image: dspace/dspace-postgres-pgcrypto:loadsql
environment:
# This LOADSQL should be kept in sync with the URL in DSpace/DSpace
- LOADSQL=https://www.dropbox.com/s/4ap1y6deseoc8ws/dspace7-entities-2019-11-28.sql?dl=1
# This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
- LOADSQL=https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-2021-04-14.sql
53 changes: 42 additions & 11 deletions docker/docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@

# Docker Compose for running the DSpace backend for e2e testing in a CI environment
# This is used by our GitHub CI at .github/workflows/build.yml
# It is based heavily on the Backend's Docker Compose:
# https://github.com/DSpace/DSpace/blob/main/docker-compose.yml
version: '3.7'
networks:
dspacenet:
services:
# DSpace (backend) webapp container
dspace:
container_name: dspace
depends_on:
Expand All @@ -26,12 +30,26 @@ services:
volumes:
- assetstore:/dspace/assetstore
- "./local.cfg:/dspace/config/local.cfg"
# Ensure that the database is ready BEFORE starting tomcat
# 1. While a TCP connection to dspacedb port 5432 is not available, continue to sleep
# 2. Then, run database migration to init database tables
# 3. Finally, start Tomcat
entrypoint:
- /bin/bash
- '-c'
- |
while (!</dev/tcp/dspacedb/5432) > /dev/null 2>&1; do sleep 1; done;
/dspace/bin/dspace database migrate
catalina.sh run
# DSpace database container
# NOTE: This is customized to use our loadsql image, so that we are using a database with existing test data
dspacedb:
container_name: dspacedb
environment:
# This LOADSQL should be kept in sync with the LOADSQL in
# https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/db.entities.yml
LOADSQL: https://www.dropbox.com/s/4ap1y6deseoc8ws/dspace7-entities-2019-11-28.sql?dl=1
# This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
LOADSQL: https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-2021-04-14.sql
PGDATA: /pgdata
image: dspace/dspace-postgres-pgcrypto:loadsql
networks:
Expand All @@ -40,26 +58,39 @@ services:
tty: true
volumes:
- pgdata:/pgdata
# DSpace Solr container
dspacesolr:
container_name: dspacesolr
image: dspace/dspace-solr
# Uses official Solr image at https://hub.docker.com/_/solr/
image: solr:8.8
networks:
dspacenet:
ports:
- published: 8983
target: 8983
stdin_open: true
tty: true
working_dir: /var/solr/data
volumes:
- solr_authority:/opt/solr/server/solr/authority/data
- solr_oai:/opt/solr/server/solr/oai/data
- solr_search:/opt/solr/server/solr/search/data
- solr_statistics:/opt/solr/server/solr/statistics/data
version: '3.7'
# Mount our local Solr core configs so that they are available as Solr configsets on container
- ./dspace/solr/authority:/opt/solr/server/solr/configsets/authority
- ./dspace/solr/oai:/opt/solr/server/solr/configsets/oai
- ./dspace/solr/search:/opt/solr/server/solr/configsets/search
- ./dspace/solr/statistics:/opt/solr/server/solr/configsets/statistics
# Keep Solr data directory between reboots
- solr_data:/var/solr/data
# Initialize all DSpace Solr cores using the mounted local configsets (see above), then start Solr
entrypoint:
- /bin/bash
- '-c'
- |
init-var-solr
precreate-core authority /opt/solr/server/solr/configsets/authority
precreate-core oai /opt/solr/server/solr/configsets/oai
precreate-core search /opt/solr/server/solr/configsets/search
precreate-core statistics /opt/solr/server/solr/configsets/statistics
exec solr -f
volumes:
assetstore:
pgdata:
solr_authority:
solr_oai:
solr_search:
solr_statistics:
solr_data:
34 changes: 25 additions & 9 deletions docker/docker-compose-rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ version: '3.7'
networks:
dspacenet:
services:
# DSpace (backend) webapp container
dspace:
container_name: dspace
image: dspace/dspace:dspace-7_x-test
Expand All @@ -40,6 +41,7 @@ services:
while (!</dev/tcp/dspacedb/5432) > /dev/null 2>&1; do sleep 1; done;
/dspace/bin/dspace database migrate
catalina.sh run
# DSpace database container
dspacedb:
container_name: dspacedb
environment:
Expand All @@ -54,25 +56,39 @@ services:
tty: true
volumes:
- pgdata:/pgdata
# DSpace Solr container
dspacesolr:
container_name: dspacesolr
image: dspace/dspace-solr
# Uses official Solr image at https://hub.docker.com/_/solr/
image: solr:8.8
networks:
dspacenet:
ports:
- published: 8983
target: 8983
stdin_open: true
tty: true
working_dir: /var/solr/data
volumes:
- solr_authority:/opt/solr/server/solr/authority/data
- solr_oai:/opt/solr/server/solr/oai/data
- solr_search:/opt/solr/server/solr/search/data
- solr_statistics:/opt/solr/server/solr/statistics/data
# Mount our local Solr core configs so that they are available as Solr configsets on container
- ./dspace/solr/authority:/opt/solr/server/solr/configsets/authority
- ./dspace/solr/oai:/opt/solr/server/solr/configsets/oai
- ./dspace/solr/search:/opt/solr/server/solr/configsets/search
- ./dspace/solr/statistics:/opt/solr/server/solr/configsets/statistics
# Keep Solr data directory between reboots
- solr_data:/var/solr/data
# Initialize all DSpace Solr cores using the mounted local configsets (see above), then start Solr
entrypoint:
- /bin/bash
- '-c'
- |
init-var-solr
precreate-core authority /opt/solr/server/solr/configsets/authority
precreate-core oai /opt/solr/server/solr/configsets/oai
precreate-core search /opt/solr/server/solr/configsets/search
precreate-core statistics /opt/solr/server/solr/configsets/statistics
exec solr -f
volumes:
assetstore:
pgdata:
solr_authority:
solr_oai:
solr_search:
solr_statistics:
solr_data:

0 comments on commit 1741678

Please sign in to comment.