UNPKG

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