Skip to content

Instantly share code, notes, and snippets.

@take4
Created September 9, 2016 02:34
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 take4/492511c0afa2543538c5c5938f5124b5 to your computer and use it in GitHub Desktop.
Save take4/492511c0afa2543538c5c5938f5124b5 to your computer and use it in GitHub Desktop.
Dockerで作るシンプルなRails開発環境
version: '2'
services:
mysql:
image: mysql
volumes:
- ./data/mysql:/var/lib/mysql
ports:
- "3306:3306"
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/myapp
ports:
- "3000:3000"
depends_on:
- mysql
FROM ruby:2.3.1
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /myapp
WORKDIR /myapp
ADD Gemfile /myapp/Gemfile
ADD Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment