Skip to content

Instantly share code, notes, and snippets.

@TakuyaHarayama
Last active March 19, 2019 09:01
Show Gist options
  • Save TakuyaHarayama/392b932cb9f90bd5c2539fc46a8815d5 to your computer and use it in GitHub Desktop.
Save TakuyaHarayama/392b932cb9f90bd5c2539fc46a8815d5 to your computer and use it in GitHub Desktop.
Simple docker for rails
version: '3'
services:
db:
image: postgres
volumes:
- datavol:/var/lib/postgresql/data
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/app_name
ports:
- "3000:3000"
depends_on:
- db
stdin_open: true
tty: true
volumes:
datavol:
FROM ruby:2.5.0
ENV LANG C.UTF-8
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /app_name
WORKDIR /app_name
ADD Gemfile /app_name/Gemfile
ADD Gemfile.lock /app_name/Gemfile.lock
RUN bundle install
COPY . /app_name
source 'https://rubygems.org'
gem 'rails'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment