This is a web application originally developed for the Preservation Lab at the University of Cincinnati. Provided that you have Ruby on Rails installed you can run this application on your local machine or server.
git clone github.com/uclibs/treatment_database
bundle install
# Run the migration to prepare the database.
rails db:migrate
rails db:seed
rails server
rails db:seed (optional)
See wiki for migration steps.
To dockerize the treatment database application in Development Mode use the following commands after setting up docker on your local machine or server.
cd \\to_the_treatment_database_directory
docker build -t treatment_database_image .
docker run -it --rm treatment_database_image bundle exec rspec
docker run -d --name treatment_database -p 3000:3000 -itP -v $(pwd):/app treatment_database_image
Then to check the containers which are running:
docker ps
If running on local machine, access the app in the browser: http://localhost:3000
Access the rails console:
docker exec -it treatment_database rails c
Access the shell:
docker exec -it treatment_database /bin/sh
To stop the container:
docker stop treatment_database
To delete the container:
docker rm treatment_database
To build the Docker image of the application in Production Mode and to run the app on NGINX server inside docker:
docker-compose build
Then:
docker-compose up
The treatment database has a test suite built with rspec, running it is simple, just call the following in the project directory:
bin/rails db:migrate RAILS_ENV=test
bundle exec rspec
docker exec -it treatment_database bundle exec rspec
Use Capistrano for deploying to QA and Production environments; local deploy not supported.
- Connect from VPN or on-campus network.
- On local terminal, type
cap qa deploy
- When prompted, type apache username.
- When prompted, type apache password.
Capistrano will deploy the qa
branch by default from the github repository for QA deploys. Switch branches for deploy to QA by altering /config/deploy/qa.rb (branch must be pushed to remote).
- Connect from VPN or on-campus network.
- On local terminal, type
cap production deploy
- When prompted, type apache username.
- When prompted, type apache password.
Capistrano will deploy the main
branch from the github repository by default for Production deploys.