Vault on Docker - UVicLibrary/Vault GitHub Wiki

One-Time Install and Startup

  1. Install Docker Desktop. For the purposes of this tutorial, we assume you're using Windows Enterprise.
  2. Clone the repo from Github. For the purposes of this tutorial, we assume the repo is in Documents\Github\Vault.
  3. For a better terminal interface than regular old Powershell, install Windows Terminal.
  4. Open Powershell (you may have to do this as administrator). In Windows Terminal, you already start in your Documents folder, so cd Github\Vault. Otherwise, cd into the cloned directory from step 2.
  5. Run docker-compose build.
  6. Once that has finished, start up with docker-compose up -d web.
  7. 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 the solr container. It is mounted locally from .\solr\vault_docker_config
  8. Verify the core was created by going to http://localhost:8983/solr/#/vault_dev in your browser.
  9. Restart the web container through the Docker interface or by running docker restart vault_web_1.
  10. In your current or a new Powershell window, use docker exec -it vault_web_1 bash to run an interactive shell into the vault_web_1 container.
  11. Go to http://localhost:3000 in the browser to see the app running.
  12. When you want to stop, run docker-compose stop in Powershell.

Starting up after One-Time Installation

  1. Start up Docker Desktop.
  2. Open a new Powershell/Terminal window and cd into the Vault folder.
  3. Run docker-compose up -d web.
  4. Start an interactive shell by running docker exec -it vault_web_1 bash.
  5. Once in the shell, run rails s -b 0.0.0.0.
  6. 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.
  7. 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