- Docker Desktop (macOS) or Docker Engine (Linux)
- Ruby (to run
bin/tools) - A
.envfile (see below) sdbmss.localhostin/etc/hosts(see below)
bin/tools is used instead of rake because rake task execution is not practical on macOS Apple silicon with this project's legacy Ruby/Rails constraints.
Important: Do not edit docker-compose.yml manually.
It is generated by scripts/generate_dev_compose.py from scripts/generate_dev_compose.yml. Edit those files instead.
From the rails_app/ directory:
cp docker-environment-sample .env
Edit .env for your environment.
Note: The following is required on macOS. It may not be needed on Linux.
Add the line below to /etc/hosts.
127.0.0.1 sdbmss.localhost
To edit the hosts file you'll need to be super user or use sudo (e.g., sudo vi /etc/hosts).
The development environment relies on these static and database files:
sdbm_data.tgz(120 MB)sdbm.sql.gz(6.3 MB)
Contact Penn Libraries' Digital Library Development team for copies.
Penn Libraries staff can access the files here (permission required): SDBM Data on SharePoint.
Place them in rails_app/dev/data/.
Optional: override the default archive paths via environment variables in
.env:
SDBM_DATA_ARCHIVE=/path/to/sdbm_data.tgzSDBM_SQL_ARCHIVE=/path/to/sdbm.sql.gz
From rails_app/:
bin/tools start
Builds any missing custom images, then starts all services. Waits for HTTP 200 on $SDBMSS_APP_HOST before returning, and runs host diagnostics for /etc/hosts mapping and connectivity issues.
bin/tools setup
This loads the database, copies static assets, adds test users, reindexes Solr, and loads Jena. Takes about 5 minutes.
Go to http://sdbmss.localhost. Log in as admin / testpassword.
| Command | What it does |
|---|---|
bin/tools start |
Start all services |
bin/tools stop |
Stop all services (volumes preserved) |
bin/tools clean |
Remove services and volumes |
bin/tools clean --all |
Remove services, volumes, and custom images |
bin/tools rebuild |
Rebuild all custom images (no start) |
bin/tools start --force-rebuild |
Rebuild custom images before starting |
All commands run from rails_app/.
Tests run inside the app container:
docker exec -it sdbmss-app-1 bash
RAILS_ENV=test bundle exec rspec
Skip JS tests for a faster run: bundle exec rspec --tag ~js
The full suite takes about 14 minutes.
The services defined in docker-compose.yml are:
- The SDBM Rails app
- Solr
- MySQL
- RabbitMQ -- queue for Jena updates
- Jena Fuseki -- RDF/SPARQL server; built from https://github.com/upenn-libraries/Jena-Fuseki
- Delayed Job -- background job processing (Rails image)
- Interface -- service for updating Jena (listens to RabbitMQ queue); built from https://github.com/upenn-libraries/sdbm-interface
- Traefik -- reverse proxy
- Chrome -- development-only headless browser for specs
Edit scripts/generate_dev_compose.yml (service configuration), then run scripts/generate_dev_compose.py to regenerate docker-compose.yml.
AI Usage Disclosure: Reviewed, revised, and extended by Claude Sonnet 4.6 (Anthropic).