docker build -t [NAME] .
to see your image
docker image ls
to run the image CONTAINER_NAME is whatever you want to call the container and IMAGE_NAME is whatever you named your image in the build step.
docker run -d -p 3000:3000 --name [CONTAINER_NAME] [IMAGE_NAME]
To run the image with a bind mount
docker run -d -p 3000:3000 -v /"$(pwd)":/app --name [CONTAINER_NAME] [IMAGE_NAME]
NOTE: on windows you need a double // for anon volumes in the below case we ignore node_modules
docker run -d -p 3000:3000 -v /"$(pwd)":/app -v //app/node_modules --name [CONTAINER_NAME] [IMAGE_NAME]
To run with .env file
docker run -d -p 3000:3000 -v /"$(pwd)":/app -v //app/node_modules --env-file=.env --name [CONTAINER_NAME] [IMAGE_NAME]
To accomplish all of the following above but with just a single command, run...
docker-compose up -d
docker-compose down -v
docker-compose -f docker-compose.yaml -f docker-compose.dev.yaml up -d --build
docker-compose -f docker-compose.yaml -f docker-compose.prod.yaml up -d --build