Use explicit-type code blocks in a lot of obvious places (now that the Hub actually renders these _better_ than the no-type versions)

This commit is contained in:
Tianon Gravi
2015-08-13 09:29:14 -07:00
parent faf751d43b
commit 481f43ec2f
73 changed files with 1288 additions and 667 deletions
+12 -6
View File
@@ -14,14 +14,18 @@ Node.js internally uses the Google V8 JavaScript engine to execute code; a large
## Create a `Dockerfile` in your Node.js app project
FROM node:0.10-onbuild
# replace this with your application's default port
EXPOSE 8888
```dockerfile
FROM node:0.10-onbuild
# replace this with your application's default port
EXPOSE 8888
```
You can then build and run the Docker image:
docker build -t my-nodejs-app .
docker run -it --rm --name my-running-app my-nodejs-app
```console
$ docker build -t my-nodejs-app .
$ docker run -it --rm --name my-running-app my-nodejs-app
```
### Notes
@@ -31,4 +35,6 @@ The image assumes that your application has a file named [`package.json`](https:
For many simple, single file projects, you may find it inconvenient to write a complete `Dockerfile`. In such cases, you can run a Node.js script by using the Node.js Docker image directly:
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp node:0.10 node your-daemon-or-script.js
```console
$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp node:0.10 node your-daemon-or-script.js
```