From ff7503fd8dec549fd959c6c39ebbc2ca0e8b6bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Fri, 30 May 2025 20:13:19 +0300 Subject: [PATCH] Update Node.js version and related examples in README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- README.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fc778a31e5..b2028fd5b8 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ See: http://nodejs.org ```dockerfile # specify the node base image with your desired version node: -FROM node:16 +FROM node:22 # replace this with your application's default port EXPOSE 8888 ``` @@ -67,21 +67,18 @@ $ docker run -it --rm --name my-running-app my-nodejs-app If you prefer Docker Compose: ```yml -version: "2" services: node: - image: "node:8" + image: "node:22" user: "node" working_dir: /home/node/app environment: - NODE_ENV=production volumes: - ./:/home/node/app - expose: - - "8081" ports: # use if it is necessary to expose the container to the host machine - - "8001:8001" - command: "npm start" + - "8888:8888" + command: ["npm", "start"] ``` 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 Node.js Docker image directly: ```console -$ 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 +$ 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 ``` ### Verbosity