-
Notifications
You must be signed in to change notification settings - Fork 0
Common (Docker) Tasks
Mark Bussey edited this page Oct 21, 2019
·
3 revisions
-
Start Solr, Fedora, and Rails servers
- Type
cd ./wustl2019to change directory to the root of your Rails application - Type
docker-compose up
- Type
-
Shut down Solr, Fedora, and Rails servers
- In the terminal window where your servers are running, type ctrl-C
-
Alternative: In your main terminal window, in your project context, type
docker-compose down.
-
Start a Bash session to your application container
- Type
cd ./wustl2019to change directory to the root of your Rails application - Type
docker-compose run web bashto connect to a command prompt running in the application container - Type
exitwhen you're done to return to to your local system
- Type
-
Start a Rails console
- Type
cd ./wustl2019to change directory to the root of your Rails application - Type
docker-compose run web rails consoleto enter the console (orrails cfor shorthand) - Type
exitwhen you're done to return to your local system
- Type
-
Fix Solr if you get an error like
ERROR: Core 'hydra-test' already exists!- Clear the test solr instance using
rm -rf tmp/solr-test/server/solr/hydra-test -
ALTERNATE Try
solr_wrapper --config config/solr_wrapper_test.yml clean - Try
rails ciagain and things should work; if not, ask for help!
- Clear the test solr instance using
-
Re-set Repository (without re-pulling code)
- Keep servers running
- In a rails console (
docker-compose run web rails console)- Clean out Fedora
require 'active_fedora/cleaner' ActiveFedora::Cleaner.clean!- Clean out Solr
Blacklight.default_index.connection.delete_by_query("*:*"); Blacklight.default_index.connection.commit - On the command line
docker-compose run web bundle exec rake db:reset - On the command line,
- Standard new repo set-up
docker-compose run web bundle install docker-compose run web rails db:migrate docker-compose up docker-compose run web rails hyrax:default_collection_types:create docker-compose run web rails hyrax:default_admin_set:create
- To use byebug:
- After hitting the byebug in your code, run docker ps to get the id for the web container. Copy that id and then run:
docker attach 943094304
- Hit enter and you'll be in the byebug.