Last active
November 1, 2019 02:33
-
-
Save gitDbits/60f6e1a8895b43cf716762157f412a6b to your computer and use it in GitHub Desktop.
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
| # Command create project | |
| sudo docker run -it --rm --user "$(id -u):$(id -g)" -v "$PWD":/usr/src/app -w /usr/src/app rails rails new --skip-bundle my_awesome_app | |
| # Create Dockerfile in project | |
| FROM ruby:2.5.3 | |
| RUN mkdir -p /usr/src/app | |
| WORKDIR /usr/src/app | |
| RUN apt-get update && apt-get install -y nodejs --no-install-recommends && rm -rf /var/lib/apt/lists/* | |
| RUN apt-get update && apt-get install -y sqlite3 --no-install-recommends && rm -rf /var/lib/apt/lists/* | |
| COPY Gemfile /usr/src/app/ | |
| RUN bundle install | |
| COPY . /usr/src/app | |
| EXPOSE 3000 | |
| CMD puma -C config/puma.rb | |
| # Run command build docker | |
| docker build -t name_app . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment