README: Updated the docker-compose example
Switched to a snippet that works out of the box with a package.json that has a start script.
This commit is contained in:
parent
c37d5e87fa
commit
42207ca097
|
@ -63,17 +63,20 @@ $ docker run -it --rm --name my-running-app my-nodejs-app
|
||||||
|
|
||||||
If you prefer Docker Compose:
|
If you prefer Docker Compose:
|
||||||
|
|
||||||
```yaml
|
```yml
|
||||||
version: "2"
|
version: "2"
|
||||||
services:
|
services:
|
||||||
node:
|
node:
|
||||||
image: "node:8"
|
image: "node:8"
|
||||||
|
user: "node"
|
||||||
|
working_dir: /home/node/app
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/usr/src/app
|
- ./:/home/node/app
|
||||||
expose:
|
expose:
|
||||||
- "8080"
|
- "8081"
|
||||||
|
command: "npm start"
|
||||||
```
|
```
|
||||||
|
|
||||||
You can then run using Docker Compose:
|
You can then run using Docker Compose:
|
||||||
|
|
Loading…
Reference in New Issue