Skip to content

Image and compose specs for running DSpace in a compose environment, currently only intended for development

Notifications You must be signed in to change notification settings

uoregon-libraries/dspace-containers

Repository files navigation

DSpace Compose Wrapper Thing

This is a compose setup with various Dockerfiles for recreating a fairly close approximation of our production setup for running DSpace. This is for development, not to stand up a new environment in compose.

Get projects

To use this, you must first check out a copy of both the REST and Angular projects. In our case, it looks a bit like this:

git checkout git@github.com:uoregon-libraries/scholarsbank-angular.git ./dspace-angular
git checkout git@github.com:uoregon-libraries/scholarsbank-rest.git ./dspace-rest

Note: on each image build (e.g., docker compose build), you will be adding most of the files from your local copy of those two repositories. If you aren't careful, this can be a huge debugging nightmare!

Do not use local.cfg: this file is replaced with one that forces the stack to behave a certain way.

If you're seeing odd issues when you build and run the stack, consider forcibly resetting the state of those repos (e.g., git clean, git reset --hard, etc.) and doing a full image rebuild.

Build images

Build the images, e.g., docker compose build. This can take a long time....

Get data

Next, you'll want to get an export and import it locally:

  1. Stop the stack if it's running
  2. ssh into the server that runs your database
  3. Execute pg_dump -U dspace dspace > /tmp/pg.sql
  4. scp or rsync the export into exports/db, e.g., scp server@university.edu:/tmp/pg.sql ./exports/db
  5. Get your exports/db into the db container, e.g., with a compose override that adds a volume: ./exports/db:/docker-entrypoint-initdb.d
  6. Remove your current database volume, e.g., docker volume rm dspace_db
  7. Start the stack up again, and postgres will import the SQL fairly quickly (faster than the angular side boots up)
  8. Reindex: docker compose exec rest /usr/local/dspace/bin/dspace index-discovery -b

Create local admin

You'll probably want a local admin for easier access:

docker compose run --rm -it rest /usr/local/dspace/bin/dspace create-administrator -e admin@example.org -p adm -f Ad -l Min

Customize Compose Config

Use compose.override.example.yml to create a compose override. Two very minor notes you must not ignore:

  • This is mandatory! If you don't provide an override, you won't have the app exposed to the host machine, DSpace won't know its URLs, etc.
  • Do not just copy and paste! Some of the example settings only make sense in certain contexts!

Start it up!

Finally, start up the stack and browse to http://localhost:8080

About

Image and compose specs for running DSpace in a compose environment, currently only intended for development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published