Skip to content

ESSI Developer Guide

Andy Smith edited this page Feb 21, 2019 · 2 revisions

Docker deployment

Deployment to a server

TO-DO

Deployment to a local development environment

When building and deploying to a local developer's machine, the copy and ignore rules allow the db/development.sqlite3 file, which is the default database file if no further configuration changes are made, to be copied in from the local directory into the running container. This gets around the issue of not having a properly migrated database in place when the Rails app starts. One benefit of including the developer's database file in the build is that the running Rails app in the container will be identical to the when it is running as a local Rails app because the database will be the same and presumably be pointed to the same Fedora/Solr.

So to build correctly and deploy, the local environment should be complete with a migrated database and the necessary AdminSet task completed:

  1. git clone...; cd to cloned directory)

  2. bundle exec rake db:migrate

  3. In separate windows, provide Fedora/Solr for the container:

  • solr_wrapper
  • fcrepo_wrapper
  1. Once Fedora/Solr are running, create the AdminSet in the local app directory:
  • bundle exec rails hyrax:default_admin_set:create
  1. Now build and run:
  • docker build --tag=essi .
  • docker run --net="host" -p 3000:3000 essi

Notes:

  • A local instance of Redis should also be running on the host machine.
  • If using Docker for Mac, all localhost and 127.0.0.1 references should be replaced with host.docker.internal in config/essi_config.example.yml.