mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 23:13:10 +00:00
Merge pull request #2635 from tdonohue/docker_wait_on_db
[Docker] Ensure dspace container waits until db is accepting connections before starting Tomcat
This commit is contained in:
@@ -20,11 +20,15 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- assetstore:/dspace/assetstore
|
- assetstore:/dspace/assetstore
|
||||||
- ./dspace/src/main/docker-compose/local.cfg:/dspace/config/local.cfg
|
- ./dspace/src/main/docker-compose/local.cfg:/dspace/config/local.cfg
|
||||||
# Ensure that the database is ready before starting tomcat
|
# 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:
|
entrypoint:
|
||||||
- /bin/bash
|
- /bin/bash
|
||||||
- '-c'
|
- '-c'
|
||||||
- |
|
- |
|
||||||
|
while (!</dev/tcp/dspacedb/5432) > /dev/null 2>&1; do sleep 1; done;
|
||||||
/dspace/bin/dspace database migrate
|
/dspace/bin/dspace database migrate
|
||||||
catalina.sh run
|
catalina.sh run
|
||||||
dspacedb:
|
dspacedb:
|
||||||
@@ -34,6 +38,9 @@ services:
|
|||||||
image: dspace/dspace-postgres-pgcrypto
|
image: dspace/dspace-postgres-pgcrypto
|
||||||
networks:
|
networks:
|
||||||
dspacenet:
|
dspacenet:
|
||||||
|
ports:
|
||||||
|
- published: 5432
|
||||||
|
target: 5432
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
tty: true
|
tty: true
|
||||||
volumes:
|
volumes:
|
||||||
|
Reference in New Issue
Block a user