Move onbuild related notes under onbuild image variant docs (#542)

* Move onbuild related notes under onbuild docs

* Document docker compose example assumptions
This commit is contained in:
Joni Salmi 2017-10-11 15:43:46 +03:00 committed by Simen Bekkhus
parent 109541d1b4
commit 1d71e2a31f
1 changed files with 14 additions and 13 deletions

View File

@ -14,7 +14,6 @@ The official Node.js docker image, made with love by the node community.
- [What is Node.js?](#what-is-nodejs)
- [How to use this image](#how-to-use-this-image)
- [Create a `Dockerfile` in your Node.js app project](#create-a-dockerfile-in-your-nodejs-app-project)
- [Notes](#notes)
- [Best Practices](#best-practices)
- [Run a single Node.js script](#run-a-single-nodejs-script)
- [Verbosity](#verbosity)
@ -85,18 +84,9 @@ You can then run using Docker Compose:
$ docker-compose up -d
```
### Notes
The image assumes that your application has a file named
[`package.json`](https://docs.npmjs.com/files/package.json) listing its
dependencies and defining its [start
script](https://docs.npmjs.com/misc/scripts#default-values).
It also assumes that you have a file named [`.dockerignore`](https://docs.docker.com/engine/reference/builder/#/dockerignore-file) otherwise it will copy your local npm modules:
```
node_modules
```
Docker Compose example copies your current directory (including node_modules) to the container.
It assumes that your application has a file named [`package.json`](https://docs.npmjs.com/files/package.json)
defining [start script](https://docs.npmjs.com/misc/scripts#default-values).
## Best Practices
@ -241,6 +231,17 @@ Note that npm installs devDependencies by default, which is undesirable if
you're building a production image. To avoid this pass NODE_ENV as a build
argument i.e. `docker build --build-arg NODE_ENV=production …`.
The image assumes that your application has a file named
[`package.json`](https://docs.npmjs.com/files/package.json) listing its
dependencies and defining its [start
script](https://docs.npmjs.com/misc/scripts#default-values).
It also assumes that you have a file named [`.dockerignore`](https://docs.docker.com/engine/reference/builder/#/dockerignore-file) otherwise it will copy your local npm modules:
```
node_modules
```
## `node:slim`
This image does not contain the common packages contained in the default tag and