title: Why is Live Reload Slow for Angular app in Docker?
body: <p>I'm running a Rails backend with Angular front end inside of a Docker image.
  The host machine is running OSX.</p>
  
  <p>The services come up fine when I run <code>docker-compose up --build</code> but any changes to the front end files take nearly an hour to trigger a hot reload.</p>
  
  <p>If I run the build process manually in a bash session for the ng container, 
  (<code>ng build --aot</code>), it takes about 2 minutes.  Not optimal, but better than an hour. That same build process takes way longer when it's part of a hot reload.  I'm not sure why.</p>
  
  <p>I tried the solution mentioned <a href="https://stackoverflow.com/questions/44176922/docker-container-doesnt-reload-angular-app">here</a>, about opening up the port for webpack hot reloads and adding the port number inside <code>docker-compose.yml</code> but I saw no difference in behavior.</p>
  
  <p>The Rails part of this works fine.  Changing a file is almost immediately noticed in the container.</p>
  
  <p>But things aren't as snappy for the ng container.  The node_modules directory is excluded from my Docker image, so when Docker builds, it populates its own node_modules directory inside the image.  That should mean that there are no issues syncing node modules on the host machine with what's in the image.</p>
  
  <p>I've done some research and it looks like there's an option to run <code>ng eject</code>, which would enable me to customize the webpack config.  There are a few suggestions about modifying the config to speed things up, e.g. <a href="https://github.com/webpack/webpack-dev-server/issues/143#issuecomment-242909999" rel="nofollow noreferrer">this one</a>.  However, given that the eject option isn't supported in ng 6, I'd prefer not to go down this road.</p>
  
  <p>Any ideas on how I can speed up the compilation time for this ng app?</p>