An Interest In:
Web News this Week
- April 3, 2024
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
November 21, 2022 12:59 am GMT
Original Link: https://dev.to/devlogbook/create-node-app-using-docker-without-installing-node-locally-3fep
Create Node app using Docker without installing Node Locally
Almost all tutorials shows how to initialize a node app with Node installed locally. Here is a way to create a node app in Docker without installing Node locally.
Initialize a node app in the current directory with Docker:
- Replace
npm init
with whatever npm command is needed
docker run --rm -v "$PWD:/$(basename $PWD)" -w "/$(basename $PWD)" -it node:current-alpine sh -c "npm init"
Info
-rm
remove-v
volume$PWD
path to current directorybasename
last element of file path-w
working directory-it
interactive docker terminal-c
context, without it sh will not work
Original Link: https://dev.to/devlogbook/create-node-app-using-docker-without-installing-node-locally-3fep
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To