Skip to content

Instantly share code, notes, and snippets.

@vierarb

vierarb/Dockerfile

Created Aug 14, 2017
Embed
What would you like to do?
Docker configuration
version: "3"
services:
db:
image: postgres
redis:
image: redis
web:
build: .
command: foreman start -f Procfile.dev
volumes:
- app-web-sync:/app:nocopy
- app-bundle-sync:/bundle:nocopy
environment:
RAILS_ENV: development
ports:
- "5000:5000"
depends_on:
- db
- redis
volumes:
app-web-sync:
external: true
app-bundle-sync:
external: true
version: "2"
options:
verbose: true
syncs:
app-web-sync:
src: "./app"
sync_strategy: "unison"
sync_excludes: ['.gitignore', '.git/', 'tmp', 'log']
sync_args: '-v --inplace'
notify_terminal: false
watch_excludes: ['.*/.git', '.gitignore', 'docker-*.yml', 'Dockerfile']
watch_args: '-v'
app-bundle-sync:
src: "./bundle"
sync_strategy: "unison"
FROM ruby:2.4.1
RUN apt-get update -qq && apt-get install -y build-essential
# for postgres
RUN apt-get install -y libpq-dev
# for nokogiri
RUN apt-get install -y libxml2-dev libxslt1-dev
# for a JS runtime
RUN apt-get install -y nodejs
# Install Redis
RUN apt-get install -y redis-server
# Install Imagemagick
RUN apt-get install -y imagemagick
ENV APP_HOME /app
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
ADD Gemfile* $APP_HOME/
RUN gem install --no-ri --no-rdoc bundler
RUN bundle install
# Install foreman
RUN gem install foreman
# Add default foreman config
ADD Procfile $APP_HOME/Procfile.dev
ADD . $APP_HOME
CMD foreman start -f Procfile.dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment