Last active
May 30, 2018 12:47
-
-
Save wellingtonpgp/f7aaf7ffc9651aa0df6785321f1077fd to your computer and use it in GitHub Desktop.
Docker for windows
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
| Rails + Docker | |
| * docker run -it -v "%cd%":/usr/src/app -w /usr/src/app rails rails new --skip-bundle my_awesome_app | |
| ---- | |
| Dockerfile | |
| FROM ruby:2.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 | |
| ---- | |
| docker build -t my_awesome_app . | |
| ---- | |
| docker run -v "%cd%":/usr/src/app my_awesome_app rails db:create | |
| ---- | |
| docker run -v "%cd%":/usr/src/app my_awesome_app rails g scaffold notice title:text body:text | |
| ---- | |
| docker run -v "%cd%":/usr/src/app my_awesome_app rails db:migrate | |
| ---- | |
| docker run -v "%cd%":/usr/src/app -t -p 3000:3000 my_awesome_app | |
| ---- | |
| http://localhost:3000/notices |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment