Skip to content

Instantly share code, notes, and snippets.

@dakatsuka
Created August 11, 2015 07: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 dakatsuka/352dfa1b58d156fd3157 to your computer and use it in GitHub Desktop.
Save dakatsuka/352dfa1b58d156fd3157 to your computer and use it in GitHub Desktop.
Dockerfile for Ruby on Rails
FROM ruby:2.2.2
RUN apt-get update && apt-get install -y nodejs npm mysql-client --no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY Gemfile /usr/src/app/
COPY Gemfile.lock /usr/src/app/
COPY package.json /usr/src/app/
RUN bundle install -j4
RUN npm install
COPY . /usr/src/app
EXPOSE 3000
CMD ["bundle", "exec", "unicorn", "-p", "3000", "-c", "config/unicorn/docker.rb"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment