-
Notifications
You must be signed in to change notification settings - Fork 1
Common Tasks
Run these commands from the hyrax_demo
directory of your host system – i.e., not inside the container.
-
Stop the containers if they're running:
docker-compose down
-
Start the containers if they're not running:
docker-compose up
-
Connect to a
Note that this doesn't actually connect to the container that's running your web server. Instead, it creates a _new_ container based on the same image. This is the docker philosophy of keeping things isolated – _contained_, if you will.web
container to run ruby commands:docker-compose run web bash
-
Run a single command in a container:
docker-compose run web [command]
e.g.
docker-compose run web rake db:setup
-
Wipe out everything and start over
The `--volumes` bit tells docker to destroy all your data volumes. This includes your Fedora, Solr, and mysql data, so make sure you only do this if that's what you want!docker-compose down --volumes
(or justdocker-compose down -v
) -
See the output from a single container
docker-compose logs [container]
e.g.docker-compose logs web
-
Restart the rails server
docker-compose restart web
- This tutorial assumes that you run the examples within your container from the
./hyrax_demo
directory - The entire
/hyrax_demo
directory in your container is mounted from the same directory on your host machine (laptop), so you can use your favorite editor or IDE to edit files easily atpath-you-started-from-on-your-host-system/hyrax_demo
- Inside the guest machine, you can also use common Linux editors like
vim
andnano
to edit files.
Unless otherwise noted, these should be run inside your web
container – e.g., in a shell you opened with docker-compose run web bash
.
-
Start a Rails console
- Type
rails console
to enter the console (orrails c
for shorthand)
- Type
-
Run any outstanding / new database migrations
- Type
rails db:migrate
- Type
-
Reset your development repository to a completely empty state
rails db:drop rails db:migrate rails console # inside the rails console from the irb> prompt require 'active_fedora/cleaner' ActiveFedora::Cleaner.clean! exit # back at your bash # prompt rails hyrax:default_admin_set:create