4Science / DSpace

This repository contains the 4Science optimized DSpace & DSpace-CRIS distribution.
https://wiki.lyrasis.org/display/DSPACECRIS/
BSD 3-Clause "New" or "Revised" License
44 stars 63 forks source link

Fix Docker build for DSpace-CRIS backend #469

Open tdonohue opened 1 month ago

tdonohue commented 1 month ago

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:

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 "dspacedemo+admin@gmail.com".

    docker compose -p dcris7 -f docker-compose-cli.yml run --rm dspace-cli create-administrator -e dspacedemo+admin@gmail.com -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 dspacedemo+admin@gmail.com -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 commented 1 month ago

@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.