-
Notifications
You must be signed in to change notification settings - Fork 1
Common (Docker) Tasks
Rachel Kadel edited this page Mar 9, 2020
·
4 revisions
-
Start Solr, Fedora, and Rails servers
- Type
cd ./unc2020
to 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 ./unc2020
to change directory to the root of your Rails application - Type
docker-compose run web bash
to connect to a command prompt running in the application container - Type
exit
when you're done to return to to your local system
- Type
-
Start a Rails console
- Type
cd ./unc2020
to change directory to the root of your Rails application - Type
docker-compose run web rails console
to enter the console (orrails c
for shorthand) - Type
exit
when 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 ci
again 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
-
The Railsbridge docker setup by default installs files as the root user, which can cause "Permission Denied" errors at some steps. Workaround: when these errors occur, assign file ownership to your local user by typing "sudo chown -R username: ." into your terminal (substitute your own username for 'username'). Fix: add the line "USER username" to the Dockerfile after the line that begins "RUN apt-get".
- 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.