Last active
April 5, 2018 16:35
-
-
Save th0j/11c568b082bb8317f00b3a33ce304699 to your computer and use it in GitHub Desktop.
Docker alpine + Rails + Postgresql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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