Angular Docker hot reload not working on windows









up vote
1
down vote

favorite
1












Running a freshly created angular app in a docker container in windows does not hot reload the app on changes.
I tried this Docker container doesn't reload Angular app.



but keeps failing, if I create the image then run the container I get:



web_1 | npm ERR! enoent ENOENT: no such file or directory, open '/usr/src/app/package.json'



I also tried following this article (Works on Mac but not Windows):
Dockerizing an Angular App



I tried adding --poll to my angular.json:



"docker": 
"poll": 2000
,


  • This is my DockerFile


FROM node:8.11.2

# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app

# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH

COPY package.json /usr/src/app/package.json
RUN npm install
RUN npm install -g @angular/cli@6.1.5

# add app
COPY . /usr/src/app

EXPOSE 4200 49153
# start app
CMD ng serve --port 4200 --host 0.0.0.0 --poll 1



That's how I run it:
docker build -t something-clever .



For the container:
docker run -it -v C:/Users/test-docker -v /usr/src/app/node_module -p 4200:4200 -p 49153:49153 --rm something-clever bash -c "npm start"



Any help is appreciated.
Thank you.










share|improve this question

















This question has an open bounty worth +50
reputation from Nadhir Falta ending ending at 2018-11-19 01:17:23Z">in 2 days.


This question has not received enough attention.















  • I had the same issue on my windows desktop and docker. Try to add --poll to your ng serve command: ng serve --host 0.0.0.0 --port 4256 --configuration hmr --source-map=false --hmr-warning=false --poll 1. ` --poll Enable and define the file watching poll time period in milliseconds.`
    – Dmitry Bykadorov
    Nov 10 at 8:15















up vote
1
down vote

favorite
1












Running a freshly created angular app in a docker container in windows does not hot reload the app on changes.
I tried this Docker container doesn't reload Angular app.



but keeps failing, if I create the image then run the container I get:



web_1 | npm ERR! enoent ENOENT: no such file or directory, open '/usr/src/app/package.json'



I also tried following this article (Works on Mac but not Windows):
Dockerizing an Angular App



I tried adding --poll to my angular.json:



"docker": 
"poll": 2000
,


  • This is my DockerFile


FROM node:8.11.2

# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app

# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH

COPY package.json /usr/src/app/package.json
RUN npm install
RUN npm install -g @angular/cli@6.1.5

# add app
COPY . /usr/src/app

EXPOSE 4200 49153
# start app
CMD ng serve --port 4200 --host 0.0.0.0 --poll 1



That's how I run it:
docker build -t something-clever .



For the container:
docker run -it -v C:/Users/test-docker -v /usr/src/app/node_module -p 4200:4200 -p 49153:49153 --rm something-clever bash -c "npm start"



Any help is appreciated.
Thank you.










share|improve this question

















This question has an open bounty worth +50
reputation from Nadhir Falta ending ending at 2018-11-19 01:17:23Z">in 2 days.


This question has not received enough attention.















  • I had the same issue on my windows desktop and docker. Try to add --poll to your ng serve command: ng serve --host 0.0.0.0 --port 4256 --configuration hmr --source-map=false --hmr-warning=false --poll 1. ` --poll Enable and define the file watching poll time period in milliseconds.`
    – Dmitry Bykadorov
    Nov 10 at 8:15













up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





Running a freshly created angular app in a docker container in windows does not hot reload the app on changes.
I tried this Docker container doesn't reload Angular app.



but keeps failing, if I create the image then run the container I get:



web_1 | npm ERR! enoent ENOENT: no such file or directory, open '/usr/src/app/package.json'



I also tried following this article (Works on Mac but not Windows):
Dockerizing an Angular App



I tried adding --poll to my angular.json:



"docker": 
"poll": 2000
,


  • This is my DockerFile


FROM node:8.11.2

# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app

# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH

COPY package.json /usr/src/app/package.json
RUN npm install
RUN npm install -g @angular/cli@6.1.5

# add app
COPY . /usr/src/app

EXPOSE 4200 49153
# start app
CMD ng serve --port 4200 --host 0.0.0.0 --poll 1



That's how I run it:
docker build -t something-clever .



For the container:
docker run -it -v C:/Users/test-docker -v /usr/src/app/node_module -p 4200:4200 -p 49153:49153 --rm something-clever bash -c "npm start"



Any help is appreciated.
Thank you.










share|improve this question















Running a freshly created angular app in a docker container in windows does not hot reload the app on changes.
I tried this Docker container doesn't reload Angular app.



but keeps failing, if I create the image then run the container I get:



web_1 | npm ERR! enoent ENOENT: no such file or directory, open '/usr/src/app/package.json'



I also tried following this article (Works on Mac but not Windows):
Dockerizing an Angular App



I tried adding --poll to my angular.json:



"docker": 
"poll": 2000
,


  • This is my DockerFile


FROM node:8.11.2

# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app

# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH

COPY package.json /usr/src/app/package.json
RUN npm install
RUN npm install -g @angular/cli@6.1.5

# add app
COPY . /usr/src/app

EXPOSE 4200 49153
# start app
CMD ng serve --port 4200 --host 0.0.0.0 --poll 1



That's how I run it:
docker build -t something-clever .



For the container:
docker run -it -v C:/Users/test-docker -v /usr/src/app/node_module -p 4200:4200 -p 49153:49153 --rm something-clever bash -c "npm start"



Any help is appreciated.
Thank you.







angular docker






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 18:00

























asked Nov 9 at 17:53









Nadhir Falta

879313




879313






This question has an open bounty worth +50
reputation from Nadhir Falta ending ending at 2018-11-19 01:17:23Z">in 2 days.


This question has not received enough attention.








This question has an open bounty worth +50
reputation from Nadhir Falta ending ending at 2018-11-19 01:17:23Z">in 2 days.


This question has not received enough attention.













  • I had the same issue on my windows desktop and docker. Try to add --poll to your ng serve command: ng serve --host 0.0.0.0 --port 4256 --configuration hmr --source-map=false --hmr-warning=false --poll 1. ` --poll Enable and define the file watching poll time period in milliseconds.`
    – Dmitry Bykadorov
    Nov 10 at 8:15

















  • I had the same issue on my windows desktop and docker. Try to add --poll to your ng serve command: ng serve --host 0.0.0.0 --port 4256 --configuration hmr --source-map=false --hmr-warning=false --poll 1. ` --poll Enable and define the file watching poll time period in milliseconds.`
    – Dmitry Bykadorov
    Nov 10 at 8:15
















I had the same issue on my windows desktop and docker. Try to add --poll to your ng serve command: ng serve --host 0.0.0.0 --port 4256 --configuration hmr --source-map=false --hmr-warning=false --poll 1. ` --poll Enable and define the file watching poll time period in milliseconds.`
– Dmitry Bykadorov
Nov 10 at 8:15





I had the same issue on my windows desktop and docker. Try to add --poll to your ng serve command: ng serve --host 0.0.0.0 --port 4256 --configuration hmr --source-map=false --hmr-warning=false --poll 1. ` --poll Enable and define the file watching poll time period in milliseconds.`
– Dmitry Bykadorov
Nov 10 at 8:15


















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53230974%2fangular-docker-hot-reload-not-working-on-windows%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53230974%2fangular-docker-hot-reload-not-working-on-windows%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo