This Docker image is based on linux and includes basic tools as well as Node.js installed using NVM.
latest- the latest version of Node.js based onUbuntu 20.10slim- the latest version of Node.js based onDebian trixie-slim
To pull the image, use the following command:
docker pull robertgontarski/nodeTo run a container based on the pulled image, use the following command:
docker run -it \
-p 3000:3000 \
-v $(pwd):/var/www \
robertgontarski/nodeTo run a container based on the pulled image using Docker Compose, create a docker-compose.yml file with the following content:
services:
node:
image: robertgontarski/node
ports:
- 3000:3000
volumes:
- .:/var/www
tty: trueThen, run the following command:
docker-compose up -dOnce the container is running, the working directory is set to /var/www. You can now work in this directory, install additional packages, run Node.js applications, etc.
To change the Node.js version, you can use the following command:
nvm install <version>If you want to use the installed version as the default, use the following command:
nvm alias default <version>This project is licensed under the MIT License - see the LICENSE file for details.