/dockerTest

Primary LanguageJavaScript

https://nodejs.org/en/docs/guides/nodejs-docker-webapp/

$ docker build -t /node-web-app .

$ docker images

$ docker run -p 49160:8080 -d /node-web-app

Get container ID

$ docker ps

Print app output

$ docker logs

Example

Running on http://localhost:8080

Enter the container

$ docker exec -it /bin/bash

$ docker ps

Example

ID IMAGE COMMAND ... PORTS ecce33b30ebf /node-web-app:latest npm start ... 49160->8080

$ curl -i localhost:49160

HTTP/1.1 200 OK X-Powered-By: Express Content-Type: text/html; charset=utf-8 Content-Length: 12 ETag: W/"c-M6tWOb/Y57lesdjQuHeB1P/qTV0" Date: Mon, 13 Nov 2017 20:53:59 GMT Connection: keep-alive

Hello world