Skip to content

Instantly share code, notes, and snippets.

@nanzhong
Last active August 29, 2015 14:11
Show Gist options
  • Save nanzhong/1aa306ec1260fce391e9 to your computer and use it in GitHub Desktop.
Save nanzhong/1aa306ec1260fce391e9 to your computer and use it in GitHub Desktop.
Dockerfile
FROM ruby:2.1.5
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN bundle install
RUN apt-get update
RUN apt-get install -y nodejs --no-install-recommends
RUN apt-get install -y mysql-client --no-install-recommends
RUN rm -rf /var/lib/apt/lists/*
EXPOSE 3000
CMD RAILS_ENV=production bundle exec rake db:create; \
RAILS_ENV=production bundle exec rake db:migrate; \
RAILS_ENV=production bundle exec rake db:seed; \
RAILS_ENV=production rails server -p 3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment