1 | # Ruby Getting Started
|
2 |
|
3 | ## Set up your environment
|
4 |
|
5 | Get the project:
|
6 |
|
7 | ```
|
8 | git clone https://github.com/heroku/ruby-getting-started
|
9 | cd https://github.com/heroku/ruby-getting-started
|
10 | ```
|
11 |
|
12 | Ensure that you can connect to Docker in this shell:
|
13 |
|
14 | ```
|
15 | docker ps
|
16 | ```
|
17 |
|
18 | ## Create a Dockerfile
|
19 |
|
20 | ```
|
21 | heroku docker:init
|
22 | ```
|
23 |
|
24 | Heroku-Docker will automatically detect that this project is a Ruby app.
|
25 |
|
26 | ## Work locally with Docker
|
27 |
|
28 | At this point, you have several available commands.
|
29 |
|
30 | For example,
|
31 | you could immediately build the project in Docker and release it to Heroku:
|
32 |
|
33 | ```
|
34 | heroku create
|
35 | heroku addons:add heroku-postgresql
|
36 | heroku docker:release
|
37 | heroku run bundle exec rake db:migrate
|
38 | heroku open
|
39 | ```
|
40 |
|
41 | You can also run the server locally in a Dockerized version of Heroku's
|
42 | Cedar-14 stack:
|
43 |
|
44 | ```
|
45 | heroku docker:start
|
46 | heroku docker:open
|
47 | ```
|
48 |
|
49 | Finally, you could open a shell in Docker to manipulate the project with
|
50 | commands like `bundle install`:
|
51 |
|
52 | ```
|
53 | heroku docker:exec bash
|
54 | ```
|
55 |
|
56 | ...or run such commands directly:
|
57 |
|
58 | ```
|
59 | heroku docker:exec bundle install
|
60 | ```
|