If you read our blog, you could remember our article about Docker explained in details. But there are more and more details appearing every time. Today we would like to share with you a new one. Portable Node development environment with Docker.
To run a simple “Hello World!” Node app, the typical tutorial asks to:
- Download and install Node
- Download and install Yarn
- To use different versions of Node, uninstall Node and install
- Install NPM packages globally
Each operating system has its own quirks making the aforementioned installations non-standard. However, access to the Node ecosystem can be standardized using Docker images.
You can gain access to the container OS with any of the following methods:
- Using a single but long
- Using a
Dockerfilecombined with a short
- Using a
Dockerfilein combination with Docker Compose.
Assuming that Node is not installed in your local system, you can use the local terminal to modify project structure and file content but you can’t issue any Node-related commands, such as
yarn add. As the server runs within the container, you are also not able to make server requests to the internal container port
If you interested to know more, check here.
Don’t forget to read pur recent material about one of the new Node.js framework – Marble.js.