Skip to content

Instantly share code, notes, and snippets.

@cupnoodle
Last active November 26, 2020 11:45
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 cupnoodle/042426d52f7d2b9f767adefcb47fbbca to your computer and use it in GitHub Desktop.
Save cupnoodle/042426d52f7d2b9f767adefcb47fbbca to your computer and use it in GitHub Desktop.
Basic Rails 6 Dockerfile
FROM ruby:2.7
# Add the key of yarn repo
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -yqq
RUN apt-get install -yqq --no-install-recommends nodejs yarn
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN bundle install && rails webpacker:install
CMD ["bin/rails", "s", "-b", "0.0.0.0"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment