Skip to content

Instantly share code, notes, and snippets.

@th0j
Last active April 5, 2018 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save th0j/11c568b082bb8317f00b3a33ce304699 to your computer and use it in GitHub Desktop.
Save th0j/11c568b082bb8317f00b3a33ce304699 to your computer and use it in GitHub Desktop.
Docker alpine + Rails + Postgresql
version: '2'
services:
db:
image: postgres:9.6.5-alpine
web:
build: .
# command: bin/rails s -p 3000 -b '0.0.0.0'
command: ./scripts/start.sh
ports:
- "3000:3000"
depends_on:
- db
volumes:
- .:/app
volumes_from:
- box
box:
image: masterclass_backend
volumes:
- /box
FROM ruby:2.4.1-alpine3.6
RUN apk add --update build-base libffi-dev libxml2-dev libxslt-dev postgresql-dev nodejs tzdata bash
ENV RAILS_ENV=production \
APP_HOME=/app
ENV BUNDLE_PATH /box
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME
ADD . $APP_HOME
COPY Gemfile $APP_HOME/Gemfile
RUN touch $APP_HOME/Gemfile.lock
RUN bundle install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment