Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Docker build for DSpace-CRIS backend #469

Open
wants to merge 14 commits into
base: dspace-cris-2023_02_x
Choose a base branch
from

Conversation

tdonohue
Copy link

@tdonohue tdonohue commented Oct 7, 2024

References

Cherry-picks / Ports the following Docker bug-fixes from DSpace to DSpace-CRIS

Description

This PR ports a number of Docker bug-fixes from DSpace to DSpace-CRIS (see above). These ports can be found in the first 13 commits in this PR.

In addition, it updates the Docker scripts for DSpace-CRIS usage & adds basic instructions to the README on how to get started. This is all in the final commit. DSpace-CRIS specific changes include:

  • Updates all default image tags to use "dspace-cris-7_x", just so they don't conflict with any default dspace-7_x images.
  • Ensures /dspace/etc/ is mounted in Docker since it stores the default CRIS layout configuration
  • docker-compose.yml updated to automatically run the required scripts to initialize entities for DSpace-CRIS.
  • DSpace-CRIS specific Solr cores are now being installed in Docker
  • Updated dspace/src/main/docker-compose/README.md to provide step by step instructions for starting up DSpace-CRIS in Docker.

WARNING: This Docker build for DSpace-CRIS is NOT meant for production. It is just for testing/development purposes.

Instructions for Reviewers

Test the DSpace-CRIS Docker installation by following steps in the README. They are copied here for reference:

  1. First, build the backend Docker images:

    docker compose -f docker-compose.yml -f docker-compose-cli.yml build
    
  2. Second, start up the backend containers: In this example we are using a Docker project named "dcris7", but any name can be used.

    docker compose -p dcris7 up -d
    

    (Wait until it starts up. Check the logs in Docker Desktop or by using docker compose -p dcris7 logs -f)

  3. Third, create an initial admin account: In this example, we are creating "[email protected]".

    docker compose -p dcris7 -f docker-compose-cli.yml run --rm dspace-cli create-administrator -e [email protected] -f Demo -l Administrator -p dspace -c en
    
  4. Fourth, initialize your DSpace-CRIS with the sample Community/Collection structure:

    docker compose -p dcris7 -f docker-compose-cli.yml run --rm dspace-cli dsrun org.dspace.administer.StructBuilder -e [email protected] -f /dspace/config/sample-structure.xml -o -
    
  5. Finally, initialize your DSpace-CRIS with the default CRIS Layout:

    docker compose -p dcris7 -f docker-compose-cli.yml run --rm dspace-cli cris-layout-tool -f /dspace/etc/conftool/cris-layout-configuration.xls
    
  6. At this point, it should be possible to use the DSpace-CRIS backend running at http://localhost:8080/server/. One way to do so is to run the Angular frontend and point it at the backend:

    • Checkout the dspace-cris-2023_02_x branch of the DSpace-CRIS frontend
    • Install prerequisites : yarn install
    • Build it: yarn build:prod
    • Create a simple config.prod.yml to point it at localhost:8080
      rest:
        ssl: false
        host: localhost
        port: 8080
        # NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
        nameSpace: /server
      
    • Start it in production mode: yarn serve:ssr
    • At this point, your locally running UI should be pointing at the backend running in Docker.

@tdonohue
Copy link
Author

tdonohue commented Oct 7, 2024

@abollini : I've found a way to get the DSpace-CRIS backend to run in Docker. This allows me (and other devs) to more easily run DSpace-CRIS locally (as the frontend is easy to install). This PR includes everything I had to do in order to make the latest 7.x version (dspace-cris-2023_02_x) of DSpace-CRIS run in Docker on my local machine. Similar changes would also be necessary on main-cris (though I wasn't sure of the stability of that branch)

Pinging you as a possible a reviewer, as I think this could be useful. Feel free to delegate it though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants