0

I'm trying to work on a dev environment with Node.js and Docker.

I want to be able to:

  • run my docker container when I boot my computer once and for all;
  • make changes in my local source code and see the changes without interacting with the docker container (with a mount).

I've tried the Node image and, if I understand correctly, it is not what I'm looking for.

I know how to make the mount point, but I'm missing how the server is supposed to detect the changes and "relaunch" itself.

I'm new to Node.js so if there is a better way to do things, feel free to share.

1 Answer 1

1

run my docker container when I boot my computer once and for all;

start containers automatically with the docker daemon or with your process manager

make changes in my local source code and see the changes without interacting with the docker container (with a mount).

You need to mount your dev app folder as a volume

$ docker run --name myapp -v /app/src:/app image/app

and set in your Dockerfile nodeJs

CMD ["nodemon", "-L", "/app"]

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.