Skip to content

Instantly share code, notes, and snippets.

@KidusMT
Last active September 14, 2020 07:48
Show Gist options
  • Save KidusMT/504e2321ad21a85dcef7154c18e97962 to your computer and use it in GitHub Desktop.
Save KidusMT/504e2321ad21a85dcef7154c18e97962 to your computer and use it in GitHub Desktop.
  1. Issue docker-compose down --volume to remove both db and app containers and the database volume as well. Removing the volume is necessary because we have structural change in the database (i.e. we have added the hours field.
  2. Do docker-compose build app to rebuild your app image
  3. Do docker-compose up -d db app to start both containers
  4. Run docker-compose exec app rails db:create to create the databases
  5. Run docker-compose exec app rails db:migrate to run the migrations
  6. Run docker-compose exec app rails db:seed to run the seed

docker run -it b8f3669a1919 bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment