This is a compose setup with various Dockerfiles for recreating a fairly close approximation of our production setup for running DSpace. This is mostly for development, but we're trying to make it more production-ready.
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 MinCopy .env.example to .env and edit it. This is mandatory. All
per-environment settings live in .env, and you need to understand them and
set them for your setup. Note: variables exported in your shell override
.env values silently. For dev systems where the environment can be easily
polluted, be careful to check for collisions.
A compose.override.yml is optional and only needed for structural changes:
angular's live-reload, volume overrides, etc. See
compose.override.example.yml.
One-off / temporary Caddy rules are dropped into the caddy-conf volume,
applied with a restart or reload of the web service. See
docs/caddy-drop-ins.md.
Finally, start up the stack and browse to http://localhost:8080