File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ See: http://nodejs.org
5353
5454``` dockerfile
5555# specify the node base image with your desired version node:<version>
56- FROM node:16
56+ FROM node:22
5757# replace this with your application's default port
5858EXPOSE 8888
5959```
@@ -68,21 +68,18 @@ $ docker run -it --rm --name my-running-app my-nodejs-app
6868If you prefer Docker Compose:
6969
7070``` yml
71- version : " 2"
7271services :
7372 node :
74- image : " node:8 "
73+ image : " node:22 "
7574 user : " node"
7675 working_dir : /home/node/app
7776 environment :
7877 - NODE_ENV=production
7978 volumes :
8079 - ./:/home/node/app
81- expose :
82- - " 8081"
8380 ports : # use if it is necessary to expose the container to the host machine
84- - " 8001:8001 "
85- command : " npm start"
81+ - " 8888:8888 "
82+ command : [ "npm", " start"]
8683` ` `
8784
8885You can then run using Docker Compose:
@@ -106,7 +103,7 @@ complete `Dockerfile`. In such cases, you can run a Node.js script by using the
106103Node.js Docker image directly:
107104
108105``` console
109- $ docker run -it --rm --name my-running-script -v " $PWD " :/usr/src/app -w /usr/src/app node:8 node your-daemon-or-script.js
106+ $ docker run -it --rm --name my-running-script -v " $PWD " :/usr/src/app -w /usr/src/app node:22 node your-daemon-or-script.js
110107```
111108
112109### Verbosity
You can’t perform that action at this time.
0 commit comments