mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-10 03:23:13 +00:00
Merge branch 'main' into duracom-125
This commit is contained in:
@@ -6,6 +6,5 @@ dspace/modules/*/target/
|
|||||||
Dockerfile.*
|
Dockerfile.*
|
||||||
dspace/src/main/docker/dspace-postgres-pgcrypto
|
dspace/src/main/docker/dspace-postgres-pgcrypto
|
||||||
dspace/src/main/docker/dspace-postgres-pgcrypto-curl
|
dspace/src/main/docker/dspace-postgres-pgcrypto-curl
|
||||||
dspace/src/main/docker/solr
|
|
||||||
dspace/src/main/docker/README.md
|
dspace/src/main/docker/README.md
|
||||||
dspace/src/main/docker-compose/
|
dspace/src/main/docker-compose/
|
||||||
|
26
.github/workflows/docker.yml
vendored
26
.github/workflows/docker.yml
vendored
@@ -170,3 +170,29 @@ jobs:
|
|||||||
# Use tags / labels provided by 'docker/metadata-action' above
|
# Use tags / labels provided by 'docker/metadata-action' above
|
||||||
tags: ${{ steps.meta_build_cli.outputs.tags }}
|
tags: ${{ steps.meta_build_cli.outputs.tags }}
|
||||||
labels: ${{ steps.meta_build_cli.outputs.labels }}
|
labels: ${{ steps.meta_build_cli.outputs.labels }}
|
||||||
|
|
||||||
|
###########################################
|
||||||
|
# Build/Push the 'dspace/dspace-solr' image
|
||||||
|
###########################################
|
||||||
|
# Get Metadata for docker_build_solr step below
|
||||||
|
- name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-solr' image
|
||||||
|
id: meta_build_solr
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: dspace/dspace-solr
|
||||||
|
tags: ${{ env.IMAGE_TAGS }}
|
||||||
|
flavor: ${{ env.TAGS_FLAVOR }}
|
||||||
|
|
||||||
|
- name: Build and push 'dspace-solr' image
|
||||||
|
id: docker_build_solr
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./dspace/src/main/docker/dspace-solr/Dockerfile
|
||||||
|
platforms: ${{ env.PLATFORMS }}
|
||||||
|
# For pull requests, we run the Docker build (to ensure no PR changes break the build),
|
||||||
|
# but we ONLY do an image push to DockerHub if it's NOT a PR
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
# Use tags / labels provided by 'docker/metadata-action' above
|
||||||
|
tags: ${{ steps.meta_build_solr.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta_build_solr.outputs.labels }}
|
||||||
|
@@ -81,8 +81,12 @@ services:
|
|||||||
# DSpace Solr container
|
# DSpace Solr container
|
||||||
dspacesolr:
|
dspacesolr:
|
||||||
container_name: dspacesolr
|
container_name: dspacesolr
|
||||||
# Uses official Solr image at https://hub.docker.com/_/solr/
|
image: "${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-dspace-7_x}"
|
||||||
image: solr:8.11-slim
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./dspace/src/main/docker/dspace-solr/Dockerfile
|
||||||
|
args:
|
||||||
|
SOLR_VERSION: "${SOLR_VER:-8.11}"
|
||||||
networks:
|
networks:
|
||||||
dspacenet:
|
dspacenet:
|
||||||
ports:
|
ports:
|
||||||
@@ -92,30 +96,25 @@ services:
|
|||||||
tty: true
|
tty: true
|
||||||
working_dir: /var/solr/data
|
working_dir: /var/solr/data
|
||||||
volumes:
|
volumes:
|
||||||
# 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
|
# Keep Solr data directory between reboots
|
||||||
- solr_data:/var/solr/data
|
- solr_data:/var/solr/data
|
||||||
# Initialize all DSpace Solr cores using the mounted local configsets (see above), then start Solr
|
# Initialize all DSpace Solr cores then start Solr:
|
||||||
# * First, run precreate-core to create the core (if it doesn't yet exist). If exists already, this is a no-op
|
# * First, run precreate-core to create the core (if it doesn't yet exist). If exists already, this is a no-op
|
||||||
# * Second, copy updated configs from mounted configsets to this core. If it already existed, this updates core
|
# * Second, copy configsets to this core:
|
||||||
# to the latest configs. If it's a newly created core, this is a no-op.
|
# Updates to Solr configs require the container to be rebuilt/restarted: `docker compose -p d7 up -d --build dspacesolr`
|
||||||
entrypoint:
|
entrypoint:
|
||||||
- /bin/bash
|
- /bin/bash
|
||||||
- '-c'
|
- '-c'
|
||||||
- |
|
- |
|
||||||
init-var-solr
|
init-var-solr
|
||||||
precreate-core authority /opt/solr/server/solr/configsets/authority
|
precreate-core authority /opt/solr/server/solr/configsets/authority
|
||||||
cp -r -u /opt/solr/server/solr/configsets/authority/* authority
|
cp -r /opt/solr/server/solr/configsets/authority/* authority
|
||||||
precreate-core oai /opt/solr/server/solr/configsets/oai
|
precreate-core oai /opt/solr/server/solr/configsets/oai
|
||||||
cp -r -u /opt/solr/server/solr/configsets/oai/* oai
|
cp -r /opt/solr/server/solr/configsets/oai/* oai
|
||||||
precreate-core search /opt/solr/server/solr/configsets/search
|
precreate-core search /opt/solr/server/solr/configsets/search
|
||||||
cp -r -u /opt/solr/server/solr/configsets/search/* search
|
cp -r /opt/solr/server/solr/configsets/search/* search
|
||||||
precreate-core statistics /opt/solr/server/solr/configsets/statistics
|
precreate-core statistics /opt/solr/server/solr/configsets/statistics
|
||||||
cp -r -u /opt/solr/server/solr/configsets/statistics/* statistics
|
cp -r /opt/solr/server/solr/configsets/statistics/* statistics
|
||||||
exec solr -f
|
exec solr -f
|
||||||
volumes:
|
volumes:
|
||||||
assetstore:
|
assetstore:
|
||||||
|
@@ -130,6 +130,23 @@ docker run -i -t -d -p 80:80 -p 443:443 dspace/dspace-shibboleth
|
|||||||
|
|
||||||
This image can also be rebuilt using the `../docker-compose/docker-compose-shibboleth.yml` script.
|
This image can also be rebuilt using the `../docker-compose/docker-compose-shibboleth.yml` script.
|
||||||
|
|
||||||
|
## dspace/src/main/docker/dspace-solr/Dockerfile
|
||||||
|
|
||||||
|
This Dockerfile builds a Solr image with DSpace Solr configsets included. It
|
||||||
|
can be pulled / built following the [docker compose resources](../docker-compose/README.md)
|
||||||
|
documentation. Or, to just build and/or run Solr:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose build dspacesolr
|
||||||
|
docker-compose -p d7 up -d dspacesolr
|
||||||
|
```
|
||||||
|
|
||||||
|
If you're making iterative changes to the DSpace Solr configsets you'll need to rebuild /
|
||||||
|
restart the `dspacesolr` container for the changes to be deployed. From DSpace root:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose -p d7 up --detach --build dspacesolr
|
||||||
|
```
|
||||||
|
|
||||||
## test/ folder
|
## test/ folder
|
||||||
|
|
||||||
|
36
dspace/src/main/docker/dspace-solr/Dockerfile
Normal file
36
dspace/src/main/docker/dspace-solr/Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#
|
||||||
|
# The contents of this file are subject to the license and copyright
|
||||||
|
# detailed in the LICENSE and NOTICE files at the root of the source
|
||||||
|
# tree and available online at
|
||||||
|
#
|
||||||
|
# http://www.dspace.org/license/
|
||||||
|
#
|
||||||
|
|
||||||
|
# To build use root as context for (easier) access to solr cfgs
|
||||||
|
# docker build --build-arg SOLR_VERSION=8.11 -f ./dspace/src/main/docker/dspace-solr/Dockerfile .
|
||||||
|
# This will be published as dspace/dspace-solr:$DSPACE_VERSION
|
||||||
|
|
||||||
|
ARG SOLR_VERSION=8.11
|
||||||
|
|
||||||
|
FROM solr:${SOLR_VERSION}-slim
|
||||||
|
|
||||||
|
ENV AUTHORITY_CONFIGSET_PATH=/opt/solr/server/solr/configsets/authority/conf \
|
||||||
|
OAI_CONFIGSET_PATH=/opt/solr/server/solr/configsets/oai/conf \
|
||||||
|
SEARCH_CONFIGSET_PATH=/opt/solr/server/solr/configsets/search/conf \
|
||||||
|
STATISTICS_CONFIGSET_PATH=/opt/solr/server/solr/configsets/statistics/conf
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
RUN mkdir -p $AUTHORITY_CONFIGSET_PATH && \
|
||||||
|
mkdir -p $OAI_CONFIGSET_PATH && \
|
||||||
|
mkdir -p $SEARCH_CONFIGSET_PATH && \
|
||||||
|
mkdir -p $STATISTICS_CONFIGSET_PATH
|
||||||
|
|
||||||
|
COPY dspace/solr/authority/conf/* $AUTHORITY_CONFIGSET_PATH/
|
||||||
|
COPY dspace/solr/oai/conf/* $OAI_CONFIGSET_PATH/
|
||||||
|
COPY dspace/solr/search/conf/* $SEARCH_CONFIGSET_PATH/
|
||||||
|
COPY dspace/solr/statistics/conf/* $STATISTICS_CONFIGSET_PATH/
|
||||||
|
|
||||||
|
RUN chown -R solr:solr /opt/solr/server/solr/configsets
|
||||||
|
|
||||||
|
USER solr
|
Reference in New Issue
Block a user