A dockerized development stack for GeoBlacklight.
Adapted from Northwestern University Library's devstack project.
$ git clone https://github.com/geoblacklight/gblstack.git
$ cd gblstack
# On MacOS
$ echo "export PATH=\$PATH:$(pwd)/bin" >> ~/.bash_profile
$ source ~/.bash_profile
# On Linux
$ echo "export PATH=\$PATH:$(pwd)/bin" >> ~/.profile
$ source ~/.profileThe gblstack command is a thin wrapper around docker-compose, and accepts
all of the same subcommands, parameters, and arguments, with a few notable enhancements:
- The
updatecommand will update the gblstack command and configs in place. docker-composecommands that accept service names as arguments can also accept application names (web,solr,db) that will be expanded to the list of services those applications depend on. For example,gblstack up webwill bring up all services required to run the blacklight web server.
gblstack -t [rest-of-command]will rungblstackin test mode. That means:- All services run on test ports instead of dev ports (e.g.,
solron8985instead of8983) - The
COMPOSE_PROJECT_NAMEwill have_testappended (e.g., the default container names will begblstack_test_*instead ofgblstack_*) - The stack will clean itself up (delete all volumes and persistent data) when it spins down.
- All services run on test ports instead of dev ports (e.g.,
gblstack up [-d] [SERVICE|APPLICATION...]: Bring up all requested services (default: all services).-dwill run everything in the background.gblstack logs [-f] [SERVICE|APPLICATION...]: Show the container logs for the specified services (default: all running services).-fbehaves the way it does for thetailcommand.gblstack down [-v]: Bring down the stack. Adding-vwill destroy the stack's persistent data volumes as well, resulting in a clean slate on the nextup.gblstack ps: View the current state of running containersgblstack update: Upgrade to the latest revision ofgblstack
- Setting the
COMPOSE_PROJECT_NAMEenvironment variable will change the prefixdocker-composeuses when creating containers and volumes, allowing you to create a temporary stack without interfering with your main stack. This can be useful for one-off debugging. - It’s a good idea to run
docker system pruneonce in a while to get rid of stopped containers, dangling images, and unused networks & volumes. If you run it while the stack is up, it won’t remove your current set of data volumes (because they'll be in use).