Skip to content

Instantly share code, notes, and snippets.

@yalab
Last active August 25, 2019 06:47
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 yalab/873f5efe849aad6abd312e0898281217 to your computer and use it in GitHub Desktop.
Save yalab/873f5efe849aad6abd312e0898281217 to your computer and use it in GitHub Desktop.
version: '3'
services:
db:
image: postgres:9.6.5
volumes:
- db-data:/var/lib/postgresql/data
ports:
- 5432:5432
app:
tty: true
stdin_open: true
build: .
command: ash -c "rm -f tmp/pids/server.pid && (bundle check || bundle install) && bundle exec rails s -b 0"
volumes:
- .:/app:cached
- gems:/gems
- yarn:/usr/local/share/.cache/yarn
ports:
- 3000:3000
depends_on:
- db
environment:
DATABASE_URL: postgres://postgres@db/app
volumes:
db-data:
gems:
yarn:
FROM ruby:2.6-alpine
ENV LANG=C.UTF-8 \
TZ=Asia/Tokyo \
ROOT_PATH=/app \
BUNDLE_JOBS=4 \
BUNDLE_PATH=/gems
VOLUME /gems
RUN mkdir $ROOT_PATH
WORKDIR $ROOT_PATH
RUN apk add --update --no-cache \
build-base \
curl-dev \
linux-headers \
libxml2-dev \
libxslt-dev \
yaml-dev \
zlib-dev \
git \
openssh \
less \
tzdata \
postgresql-dev \
libidn-dev \
yaml \
nodejs \
npm
RUN npm install -g yarn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment