diff --git a/docker/db.entities.yml b/docker/db.entities.yml
index 3d4831e151..818d14877c 100644
--- a/docker/db.entities.yml
+++ b/docker/db.entities.yml
@@ -20,4 +20,32 @@ services:
environment:
# This LOADSQL should be kept in sync with the URL in DSpace/DSpace
# 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
\ No newline at end of file
+ - LOADSQL=https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-2021-04-14.sql
+ dspace:
+ ### OVERRIDE default 'entrypoint' in 'docker-compose-rest.yml' ####
+ # 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. (Custom for Entities) enable Entity-specific collection submission mappings in item-submission.xml
+ # This 'sed' command inserts the sample configurations specific to the Entities data set, see:
+ # https://github.com/DSpace/DSpace/blob/main/dspace/config/item-submission.xml#L36-L49
+ # 4. Finally, start Tomcat
+ entrypoint:
+ - /bin/bash
+ - '-c'
+ - |
+ while (! /dev/null 2>&1; do sleep 1; done;
+ /dspace/bin/dspace database migrate
+ sed -i '/name-map collection-handle="default".*/a \\n \
+ \
+ \
+ \
+ \
+ \
+ \
+ \
+ \
+ \
+ \
+ ' /dspace/config/item-submission.xml
+ catalina.sh run
\ No newline at end of file
diff --git a/docker/docker-compose-ci.yml b/docker/docker-compose-ci.yml
index 760b558322..d2d02f0a55 100644
--- a/docker/docker-compose-ci.yml
+++ b/docker/docker-compose-ci.yml
@@ -65,6 +65,9 @@ services:
container_name: dspacesolr
# Uses official Solr image at https://hub.docker.com/_/solr/
image: solr:8.8
+ # Needs main 'dspace' container to start first to guarantee access to solr_configs
+ depends_on:
+ - dspace
networks:
dspacenet:
ports:
diff --git a/docker/docker-compose-rest.yml b/docker/docker-compose-rest.yml
index 7188768e14..c99e469941 100644
--- a/docker/docker-compose-rest.yml
+++ b/docker/docker-compose-rest.yml
@@ -63,6 +63,9 @@ services:
container_name: dspacesolr
# Uses official Solr image at https://hub.docker.com/_/solr/
image: solr:8.8
+ # Needs main 'dspace' container to start first to guarantee access to solr_configs
+ depends_on:
+ - dspace
networks:
dspacenet:
ports: