S
S
Speakermen2022-03-27 17:47:39
Docker
Speakermen, 2022-03-27 17:47:39

Does docker allow real-time work?

If you install node js, npm, mysql angular + nestjs + prisma orm in the docker container and run it, will it work without installation on the local (working PC) and update in real time? Or do you need to restart after writing new code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wonderingpeanut, 2022-03-27
@Speakermen

Can. To do this, you need to tell docker with the -v flag that you want to monitor changes to such and such a folder.

docker run \
    --name app \
    --link mongodb \
    -e MONGO_URL=mongodb \
    -e PORT=4000 \
    -p 4000:4000 \
    -v `pwd`/nodejs-with-mongodb-api-example:/src \ # WORKDIR ./src будет синхронизированна с папкой nodejs-with-mongodb-api-example. комманда pwd перед ней вернет полный путь до корневого каталога, где лежит докерфайл
    -v nodemodules:/src/node_modules \ # то же самое для node_modules
    app npm run dev:watch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question