Skip to content

Commit 0e2ac1c

Browse files
Merge pull request #2243 from mertssmnoglu/readme-node-version
2 parents 3e2ff7d + ff7503f commit 0e2ac1c

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff 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
5858
EXPOSE 8888
5959
```
@@ -68,21 +68,18 @@ $ docker run -it --rm --name my-running-app my-nodejs-app
6868
If you prefer Docker Compose:
6969

7070
```yml
71-
version: "2"
7271
services:
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
8885
You 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
106103
Node.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

0 commit comments

Comments
 (0)