From 80245afa736257ca6efa367cca03ffce53e0236c Mon Sep 17 00:00:00 2001 From: Campbell Allen Date: Tue, 21 Jan 2020 11:48:42 +0000 Subject: [PATCH] Add dev docs & optimize docker dev setup (#85) * add reusable cache store from image on image boot the gem_cache will be filled with the installed gems from docker * add getting started dev instructions * add namesake for tove back onto readme * fix formatting * Update README.md Co-Authored-By: Zach Wolfenbarger Co-authored-by: nciemniak Co-authored-by: Zach Wolfenbarger --- README.md | 30 +++++++++++++++++++++++++++--- docker-compose.yml | 9 +++++++-- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4e816d46..16ddb936 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,32 @@ # TOVE: Transcription Object Viewer/Editor -*Readme and docs coming soon* +*Readme and docs coming soon* - >“You seem very clever at explaining words, Sir,” said Alice. “Would you kindly tell me the meaning of the poem ‘Jabberwocky’?” +Prepare the Docker containers: + +``` +docker-compose build +docker-compose run --rm app bundle exec rails db:setup +docker-compose run --rm -e RAILS_ENV=test app bin/rails db:create +``` + +Run tests with: + +``` +docker-compose run --rm -e RAILS_ENV=test app bundle exec rspec +``` + +Or interactively / manually in a docker shell + +``` +docker-compose run --rm -e RAILS_ENV=test app bash +# from the bash prompt +bin/rspec +``` + +## Namesake + +>“You seem very clever at explaining words, Sir,” said Alice. “Would you kindly tell me the meaning of the poem ‘Jabberwocky’?” >\ >\ >“Let’s hear it,” said Humpty Dumpty. “I can explain all the poems that ever were invented—and a good many that haven’t been invented just yet.” @@ -37,4 +61,4 @@ And the mome raths outgrabe. >\ “They are that,” said Humpty Dumpty: “also they make their nests under sun-dials—also they live on cheese.” ---Lewis Carrol, "Through the Looking Glass" \ No newline at end of file +--Lewis Carrol, "Through the Looking Glass" diff --git a/docker-compose.yml b/docker-compose.yml index 4235808b..b65052f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ -version: '2' +version: '3' services: postgres: - image: postgres:9.4 + image: postgres:9.5 environment: - "POSTGRES_USER=tove" - "POSTGRES_PASSWORD=tove" @@ -9,10 +9,12 @@ services: app: build: context: . + dockerfile: Dockerfile args: RAILS_ENV: development volumes: - ./:/app + - gem_cache:/usr/local/bundle ports: - "3000:80" environment: @@ -21,3 +23,6 @@ services: - "DATABASE_URL_TEST=postgresql://tove:tove@postgres/tove_test" links: - postgres:postgres + +volumes: + gem_cache: \ No newline at end of file