Skip to content

Commit ff7503f

Browse files
mertssmnogluPeterDaveHello
authored andcommitted
Update Node.js version and related examples in README.md
Updates the documentation to use version 22 (LTS) instead of older versions, and modernizes Docker Compose syntax: - Bump all Node.js version references to 22 - Align ports and commands in Docker Compose example for consistency - Remove deprecated fields from Docker Compose example This keeps documentation up to date and reduces confusion for users. Signed-off-by: Mert Şişmanoğlu <[email protected]>
1 parent cde3411 commit ff7503f

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
@@ -52,7 +52,7 @@ See: http://nodejs.org
5252

5353
```dockerfile
5454
# specify the node base image with your desired version node:<version>
55-
FROM node:16
55+
FROM node:22
5656
# replace this with your application's default port
5757
EXPOSE 8888
5858
```
@@ -67,21 +67,18 @@ $ docker run -it --rm --name my-running-app my-nodejs-app
6767
If you prefer Docker Compose:
6868

6969
```yml
70-
version: "2"
7170
services:
7271
node:
73-
image: "node:8"
72+
image: "node:22"
7473
user: "node"
7574
working_dir: /home/node/app
7675
environment:
7776
- NODE_ENV=production
7877
volumes:
7978
- ./:/home/node/app
80-
expose:
81-
- "8081"
8279
ports: # use if it is necessary to expose the container to the host machine
83-
- "8001:8001"
84-
command: "npm start"
80+
- "8888:8888"
81+
command: ["npm", "start"]
8582
```
8683
8784
You can then run using Docker Compose:
@@ -105,7 +102,7 @@ complete `Dockerfile`. In such cases, you can run a Node.js script by using the
105102
Node.js Docker image directly:
106103

107104
```console
108-
$ 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
105+
$ 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
109106
```
110107

111108
### Verbosity

0 commit comments

Comments
 (0)