Vault on Docker - UVicLibrary/Vault GitHub Wiki
One-Time Install and Startup
- Install Docker Desktop. For the purposes of this tutorial, we assume you're using Windows Enterprise.
- Clone the repo from Github. For the purposes of this tutorial, we assume the repo is in
Documents\Github\Vault
. - For a better terminal interface than regular old Powershell, install Windows Terminal.
- Open Powershell (you may have to do this as administrator). In Windows Terminal, you already start in your
Documents
folder, socd Github\Vault
. Otherwise,cd
into the cloned directory from step 2. - Run
docker-compose build
. - Once that has finished, start up with
docker-compose up -d web
. - Next, we will create a core in Solr named
vault_dev
. In your Powershell window, run these commands:docker exec --user root solr chown -R solr:solr /opt/solr/server/solr
docker exec -d solr solr create_core -c vault_dev -d /opt/solr-8.7.0/server/solr/configsets/vault_dev
- The configset for the new core is in
/opt/solr-8.7.0/server/solr/configsets/vault_docker_config
in thesolr
container. It is mounted locally from.\solr\vault_docker_config
- Verify the core was created by going to http://localhost:8983/solr/#/vault_dev in your browser.
- Restart the web container through the Docker interface or by running
docker restart vault_web_1
. - In your current or a new Powershell window, use
docker exec -it vault_web_1 bash
to run an interactive shell into thevault_web_1
container. - Go to http://localhost:3000 in the browser to see the app running.
- When you want to stop, run
docker-compose stop
in Powershell.
Starting up after One-Time Installation
- Start up Docker Desktop.
- Open a new Powershell/Terminal window and
cd
into the Vault folder. - Run
docker-compose up -d web
. - Start an interactive shell by running
docker exec -it vault_web_1 bash
. - Once in the shell, run
rails s -b 0.0.0.0
. - Go to http://localhost:3000 in the browser to see the app running.
- Sometimes the web container hangs in the browser. If so, try restarting the
vault_web_1
container.
- Sometimes the web container hangs in the browser. If so, try restarting the
- When you want to stop, run
docker-compose stop
in Terminal/Powershell.
Developer Tools
The web console should already been enabled in config/environments/development.rb
:
# From http://meta-lambda.com/rails-5-web-console-and-docker
config.web_console.whitelisted_ips = Socket.ip_address_list.reduce([]) do |res, addrinfo|
addrinfo.ipv4? ? res << IPAddr.new(addrinfo.ip_address).mask(24) : res
end
Byebug should also be enabled through docker-compose.yml
:
web:
# ...
volumes:
- .:/data:consistent
stdin_open: true
tty: true