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.
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-restNote: 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 the images, e.g., docker compose build. This can take a long time....
Next, you'll want to get an export and import it locally:
- Stop the stack if it's running
sshinto the server that runs your database- Execute
pg_dump -U dspace dspace > /tmp/pg.sql scporrsyncthe export intoexports/db, e.g.,scp server@university.edu:/tmp/pg.sql ./exports/db- Get your
exports/dbinto the db container, e.g., with a compose override that adds a volume:./exports/db:/docker-entrypoint-initdb.d - Remove your current database volume, e.g.,
docker volume rm dspace_db - Start the stack up again, and postgres will import the SQL fairly quickly (faster than the angular side boots up)
- Reindex:
docker compose exec rest /usr/local/dspace/bin/dspace index-discovery -b
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 MinUse 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!
Finally, start up the stack and browse to http://localhost:8080