Skip to content

Instantly share code, notes, and snippets.

@vierarb
Created August 14, 2017 07:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vierarb/dc5d993129a03ada397a0c782a8f5150 to your computer and use it in GitHub Desktop.
Save vierarb/dc5d993129a03ada397a0c782a8f5150 to your computer and use it in GitHub Desktop.
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