Skip to content

Instantly share code, notes, and snippets.

@infinityhacks
Forked from Rudis1261/Dockerfile
Created September 16, 2018 08:58
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 infinityhacks/01303e8f75969291b41c5cc234f5148a to your computer and use it in GitHub Desktop.
Save infinityhacks/01303e8f75969291b41c5cc234f5148a to your computer and use it in GitHub Desktop.
Rails Docker Setup
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: root
password: root
post: 3306
host: mysql
development:
<<: *default
database: rails-app_development
version: '2'
services:
mysql:
image: mariadb
volumes:
- ~/Projects/database_data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root
ports:
- "3306:3306"
web:
build: .
command: bundle exec rails s -e rudi -p 3000 -b '0.0.0.0'
volumes:
- .:/usr/local/rails-app
working_dir: /usr/local/rails-app
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 apt-get install -y imagemagick
RUN mkdir /usr/local/rails-app
WORKDIR /usr/local/rails-app
ADD Gemfile Gemfile
ADD Gemfile.lock Gemfile.lock
RUN bundle install
source 'https://rubygems.org'
gem 'rails', '4.2.7.1'
gem 'mysql2', '~> 0.3.18'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment