Skip to content

Instantly share code, notes, and snippets.

@nhattan
Created March 20, 2020 09:46
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 nhattan/32f6951d94e42d63a0660d43de94dd54 to your computer and use it in GitHub Desktop.
Save nhattan/32f6951d94e42d63a0660d43de94dd54 to your computer and use it in GitHub Desktop.
Rails 6 Dockerfile
FROM ruby:2.7.0
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \
apt-get update -qq && apt-get install -y \
build-essential \
nodejs \
yarn
RUN mkdir /app
WORKDIR /app
COPY Gemfile Gemfile.lock ./
RUN gem install bundler
RUN bundle install --jobs 4 --retry 3
COPY package.json yarn.lock ./
RUN yarn install --check-files
COPY . /app
EXPOSE 3000
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment