Skip to content

Instantly share code, notes, and snippets.

@mdub
Last active September 25, 2018 11:20
Show Gist options
  • Select an option

  • Save mdub/829acad6f1efaff1890dd4d9f83c909d to your computer and use it in GitHub Desktop.

Select an option

Save mdub/829acad6f1efaff1890dd4d9f83c909d to your computer and use it in GitHub Desktop.

Revisions

  1. mdub revised this gist Apr 28, 2016. No changes.
  2. mdub created this gist Apr 28, 2016.
    14 changes: 14 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    version: "2"

    services:

    dev:
    image: ruby:2.3
    volumes:
    - .:/project
    - ruby2.3-bundle-cache:/usr/local/bundle
    working_dir: /project

    volumes:
    ruby2.3-bundle-cache:
    external: true
    11 changes: 11 additions & 0 deletions rake.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #! /bin/bash -e
    #
    # Run rake inside a docker-compose sandbox

    cd $(dirname $0)/..

    trap "docker-compose down --volumes" 0

    docker volume create --name ruby2.3-bundle-cache > /dev/null
    docker-compose run --rm dev sh -c 'bundle check > /dev/null || flock $GEM_HOME bundle install'
    docker-compose run --rm dev bundle exec rake "$@"