Skip to content

Commit e71edec

Browse files
authored
Merge pull request DSpace#12125 from tdonohue/fix_env_overrides_in_docker
[Docker] Update all Docker Compose scripts to allow for environment variable overrides (Backend port)
2 parents 241d030 + 419cbdc commit e71edec

7 files changed

Lines changed: 25 additions & 24 deletions

File tree

docker-compose-cli.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ services:
1717
# __P__ => "." (e.g. dspace__P__dir => dspace.dir)
1818
# __D__ => "-" (e.g. google__D__metadata => google-metadata)
1919
# db.url: Ensure we are using the 'dspacedb' image for our database
20-
db__P__url: 'jdbc:postgresql://dspacedb:5432/dspace'
20+
db__P__url: ${db__P__url:-jdbc:postgresql://dspacedb:5432/dspace}
2121
# solr.server: Ensure we are using the 'dspacesolr' image for Solr
22-
solr__P__server: http://dspacesolr:8983/solr
22+
solr__P__server: ${solr__P__server:-http://dspacesolr:8983/solr}
2323
volumes:
2424
# Keep DSpace assetstore directory between reboots
2525
- assetstore:/dspace/assetstore

docker-compose.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ services:
2222
# dspace__P__ui__P__url: http://localhost:4000
2323
# Set SSR URL to the Docker container name so that UI can contact container directly in Production mode.
2424
# (This is necessary for docker-compose-angular.yml as it uses production mode by default)
25-
dspace__P__server__P__ssr__P__url: http://dspace:8080/server
26-
dspace__P__name: 'DSpace Started with Docker Compose'
25+
dspace__P__server__P__ssr__P__url: ${dspace__P__server__P__ssr__P__url:-http://dspace:8080/server}
26+
dspace__P__name: ${dspace__P__name:-DSpace Started with Docker Compose}
2727
# db.url: Ensure we are using the 'dspacedb' image for our database
28-
db__P__url: 'jdbc:postgresql://dspacedb:5432/dspace'
28+
db__P__url: ${db__P__url:-jdbc:postgresql://dspacedb:5432/dspace}
2929
# solr.server: Ensure we are using the 'dspacesolr' image for Solr
30-
solr__P__server: http://dspacesolr:8983/solr
30+
solr__P__server: ${solr__P__server:-http://dspacesolr:8983/solr}
3131
# matomo.tracker.url: Ensure we are using the 'matomo' image for Matomo
32-
matomo__P__tracker__P__url: http://matomo
32+
matomo__P__tracker__P__url: ${matomo__P__tracker__P__url:-http://matomo}
3333
# proxies.trusted.ipranges: This setting is required for a REST API running in Docker to trust requests
3434
# from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above.
35-
proxies__P__trusted__P__ipranges: '172.23.0'
36-
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
35+
proxies__P__trusted__P__ipranges: ${proxies__P__trusted__P__ipranges:-172.23.0}
36+
LOGGING_CONFIG: ${LOGGING_CONFIG:-/dspace/config/log4j2-container.xml}
3737
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
3838
build:
3939
context: .

dspace/src/main/docker-compose/cli.assetstore.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
dspace-cli:
1111
environment:
1212
# This assetstore zip is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
13-
- LOADASSETS=https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/assetstore.tar.gz
13+
- LOADASSETS=${LOADASSETS:-https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/assetstore.tar.gz}
1414
entrypoint:
1515
- /bin/bash
1616
- '-c'

dspace/src/main/docker-compose/cli.ingest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
services:
1010
dspace-cli:
1111
environment:
12-
- AIPZIP=https://github.com/DSpace-Labs/AIP-Files/raw/main/dogAndReport.zip
13-
- ADMIN_EMAIL=test@test.edu
14-
- AIPDIR=/tmp/aip-dir
12+
- AIPZIP=${AIPZIP:-https://github.com/DSpace-Labs/AIP-Files/raw/main/dogAndReport.zip}
13+
- ADMIN_EMAIL=${ADMIN_EMAIL:-test@test.edu}
14+
- AIPDIR=${AIPDIR:-/tmp/aip-dir}
1515
entrypoint:
1616
- /bin/bash
1717
- '-c'

dspace/src/main/docker-compose/db.entities.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-loadsql:${DSPACE_VER:-latest}"
1212
environment:
1313
# This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
14-
- LOADSQL=https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-data.sql
14+
- LOADSQL=${LOADSQL:-https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-data.sql}
1515
dspace:
1616
### OVERRIDE default 'entrypoint' in 'docker-compose.yml ####
1717
# Ensure that the database is ready BEFORE starting tomcat

dspace/src/main/docker-compose/db.restore.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-loadsql:${DSPACE_VER:-latest}"
1616
environment:
1717
# Location where the dump SQL file will be available on the running container
18-
- LOCALSQL=/tmp/pgdump.sql
18+
- LOCALSQL=${LOCALSQL:-/tmp/pgdump.sql}
1919
volumes:
2020
# Volume which shares a local SQL file at "./pgdump.sql" to the running container
2121
# IF YOUR LOCAL FILE HAS A DIFFERENT NAME (or is in a different location), then change the "./pgdump.sql"

dspace/src/main/docker-compose/docker-compose-angular.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ services:
1818
depends_on:
1919
- dspace
2020
environment:
21-
DSPACE_UI_SSL: 'false'
22-
DSPACE_UI_HOST: dspace-angular
23-
DSPACE_UI_PORT: '4000'
24-
DSPACE_UI_NAMESPACE: /
25-
DSPACE_REST_SSL: 'false'
26-
DSPACE_REST_HOST: localhost
27-
DSPACE_REST_PORT: 8080
28-
DSPACE_REST_NAMESPACE: /server
21+
DSPACE_UI_SSL: ${DSPACE_UI_SSL:-false}
22+
DSPACE_UI_HOST: ${DSPACE_UI_HOST:-dspace-angular}
23+
DSPACE_UI_PORT: ${DSPACE_UI_PORT:-4000}
24+
DSPACE_UI_NAMESPACE: ${DSPACE_UI_NAMESPACE:-/}
25+
DSPACE_UI_BASEURL: ${DSPACE_UI_BASEURL:-http://localhost:4000}
26+
DSPACE_REST_SSL: ${DSPACE_REST_SSL:-false}
27+
DSPACE_REST_HOST: ${DSPACE_REST_HOST:-localhost}
28+
DSPACE_REST_PORT: ${DSPACE_REST_PORT:-8080}
29+
DSPACE_REST_NAMESPACE: ${DSPACE_REST_NAMESPACE:-/server}
2930
# Ensure SSR can use the 'dspace' Docker image directly (see docker-compose-rest.yml)
30-
DSPACE_REST_SSRBASEURL: http://dspace:8080/server
31+
DSPACE_REST_SSRBASEURL: ${DSPACE_REST_SSRBASEURL:-http://dspace:8080/server}
3132
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-latest-dist}"
3233
ports:
3334
- published: 4000

0 commit comments

Comments
 (0)