Skip to content

Instantly share code, notes, and snippets.

@kechol
Created February 27, 2017 13:13
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 kechol/787429078865eff623e62b0ebbe78280 to your computer and use it in GitHub Desktop.
Save kechol/787429078865eff623e62b0ebbe78280 to your computer and use it in GitHub Desktop.
version: '2'
services:
rails: &rails
env_file: .env
depends_on:
- postgres
- redis
volumes:
- .:/app
volumes_from:
- datastore
build:
context: .
dockerfile: dockerfiles/Dockerfile-rails.dev
command: bundle exec rails s -p 3000 -b '0.0.0.0'
ports:
- '3000:3000'
node:
<<: *rails
build:
context: .
dockerfile: dockerfiles/Dockerfile-node.dev
command: /app/bin/webpack-dev-server --host 0.0.0.0
ports:
- '8080:8080'
datastore:
image: busybox
volumes:
- postgres_data:/var/lib/postgresql/data
- redis_data:/data
- app_tmp:/app/tmp
- app_vendor_bundle:/app/vendor/bundle
- app_node_modules:/app/vendor/node_modules
postgres:
image: postgres:alpine
volumes_from:
- datastore
redis:
image: redis:alpine
volumes_from:
- datastore
volumes:
postgres_data:
driver: local
redis_data:
driver: local
app_tmp:
driver: local
app_vendor_bundle:
driver: local
app_node_modules:
driver: local
FROM node:6.10-alpine
ENV LANG ja_JP.UTF-8
RUN apk update && \
apk upgrade && \
apk --update --upgrade add \
build-base \
ruby
RUN mkdir /app
WORKDIR /app
COPY vendor/yarn.lock vendor/package.json /app/vendor/
RUN npm install --global yarn && \
cd /app/vendor && \
yarn install
FROM ruby:2.3-alpine
ENV LANG ja_JP.UTF-8
RUN apk update && \
apk upgrade && \
apk --update --upgrade add \
build-base \
nodejs \
git \
postgresql-dev \
libxml2-dev \
libxslt-dev \
zlib-dev \
yaml-dev
RUN mkdir /app
WORKDIR /app
COPY Gemfile Gemfile.lock ./
RUN bundle config build.nokogiri --use-system-libraries && \
bundle install -j4 --path /app/vendor/bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment