Skip to content

Commit

Permalink
Rewrite docker/dev.sh
Browse files Browse the repository at this point in the history
Uses workers container rather than web for migrations, since web is
defined to have an entrypoint which shockingly RUNS THE WEB SERVER.
Sometimes my brilliance astounds me.

Also improves the setup by pulling needed images and not rebuilding the
core image when we only really need the "overlay" (od1-dev) image.
  • Loading branch information
jechols committed Jan 6, 2017
1 parent 486c040 commit ef95376
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions docker/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@
# set up. Some things may need to be tweaked, such as only migrating once.
# Feel free to copy this to create your own docker-compose adventure!

# Stop everything
docker-compose stop
# Stop and clean up everything
docker-compose down

# Build, migrate, and clean up
docker build --rm -t oregondigital/od1 -f docker/Dockerfile-dev .
docker-compose run web bundle exec rake db:migrate
docker-compose rm -f web
docker-compose rm -f workers
docker-compose rm -f resquehead
# Pull images from dockerhub; nothing happens if you already have these
docker pull oregondigital/od1
docker pull oregondigital/solr
docker pull oregondigital/phantomjs:1.8.1
docker pull oregondigital/hydra-jetty:3.8.1-4.0

# Restart
docker-compose up
# Rebuild the od1 dev container in case of code changes
docker-compose build web

# Run migrations
docker-compose run workers bundle exec rake db:migrate

# Restart in the background
docker-compose up -d

# Follow the web logs
docker-compose logs -f web

0 comments on commit ef95376

Please sign in to comment.