https://github.com/robertgontarski/node-docker-image
This Docker image is based on Ubuntu and includes basic tools as well as Node.js installed using NVM.
https://github.com/robertgontarski/node-docker-image
docker docker-image linux nodejs
Last synced: 5 months ago
JSON representation
This Docker image is based on Ubuntu and includes basic tools as well as Node.js installed using NVM.
- Host: GitHub
- URL: https://github.com/robertgontarski/node-docker-image
- Owner: robertgontarski
- License: mit
- Created: 2024-08-15T21:29:57.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-15T23:17:49.000Z (almost 2 years ago)
- Last Synced: 2025-04-06T14:24:45.969Z (about 1 year ago)
- Topics: docker, docker-image, linux, nodejs
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NodeJS Doker Image
## Description
This Docker image is based on linux and includes basic tools as well as Node.js installed using NVM.
## Supported Tags
- `latest` - the latest version of Node.js based on `Ubuntu 20.10`
- `slim` - the latest version of Node.js based on `Debian trixie-slim`
## Installation and Usage
### Pull the Image
To pull the image, use the following command:
```bash
docker pull robertgontarski/node
```
### Run the Container via Docker
To run a container based on the pulled image, use the following command:
```bash
docker run -it \
-p 3000:3000 \
-v $(pwd):/var/www \
robertgontarski/node
```
### Run the Container via Docker Compose
To run a container based on the pulled image using Docker Compose, create a `docker-compose.yml` file with the following content:
```yaml
services:
node:
image: robertgontarski/node
ports:
- 3000:3000
volumes:
- .:/var/www
tty: true
```
Then, run the following command:
```bash
docker-compose up -d
```
### Working in the Container
Once 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.
### How to change Node.js version
To change the Node.js version, you can use the following command:
```bash
nvm install
```
If you want to use the installed version as the default, use the following command:
```bash
nvm alias default
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.