Skip to content

Instantly share code, notes, and snippets.

@hhcalder92
Created October 10, 2020 18:40
Show Gist options
  • Select an option

  • Save hhcalder92/df9066acf40ffa130039fa7d74750e11 to your computer and use it in GitHub Desktop.

Select an option

Save hhcalder92/df9066acf40ffa130039fa7d74750e11 to your computer and use it in GitHub Desktop.
generic-ruby-rails-dockerfile
# docker build -t backendsurvey .
# docker run -ti --rm -p 3000:3000 backendsurvey:latest
FROM ruby:2.7
RUN addgroup app
RUN adduser --disabled-password --gecos '' user
ENV INSTALL_PATH /opt/app
RUN mkdir -p $INSTALL_PATH
RUN gem install rails bundler
WORKDIR /opt/app
COPY . .
#RUN bundle update --bundler
RUN bundle install
RUN chown -R user:app /opt/app
USER user
EXPOSE 3000
CMD ["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