Created
October 10, 2020 18:40
-
-
Save hhcalder92/df9066acf40ffa130039fa7d74750e11 to your computer and use it in GitHub Desktop.
generic-ruby-rails-dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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