Skip to content

Instantly share code, notes, and snippets.

@tomekw
Created August 8, 2016 07:20
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomekw/d3045fc37d017a126fb88fab3947dfb8 to your computer and use it in GitHub Desktop.
Save tomekw/d3045fc37d017a126fb88fab3947dfb8 to your computer and use it in GitHub Desktop.

Dockerfile

FROM ruby:2.3.1-alpine

RUN apk --update --no-cache add build-base imagemagick less libxml2-dev libxslt-dev postgresql-dev && mkdir -p /app

WORKDIR /app

COPY Gemfile Gemfile.lock ./

RUN gem install bundler && bundle config build.nokogiri --use-system-libraries && bundle install

COPY . ./

CMD ["script/docker-entrypoint.sh"]

Part of docker-compose.yml

version: "2"
services:
  app:
    build: .
    depends_on:
      - postgres
      - rabbitmq
      - redis
    links:
      - postgres
      - rabbitmq
      - redis
    volumes:
      - .:/app
      - app-logs:/app/log
      - app-uploads:/app/public/uploads
    env_file: .env

How to use?

$ docker-compose run --rm app rspec spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment