title: Dockerized Ionic app hot reload not working
body: <p>I had an existing Ionic app which I have dockerized. The build and up commands are successful and I can access the app at <a href="http://localhost:8100/ionic-lab" rel="nofollow noreferrer">http://localhost:8100/ionic-lab</a>. However, hot reload doesn't work. Whenever I edit an HTML or CSS, those changes are nor reflected.</p>
  
  <p>My dockerfile:</p>
  
  <pre><code>FROM node:8
  COPY package.json /opt/library/
  WORKDIR /opt/library
  RUN npm install -g cordova ionic &amp;&amp; cordova telemetry off 
  # &amp;&amp; echo n | ionic start dockerized-ionic-app --skip-npm --v2 --ts
  RUN npm install &amp;&amp; npm cache verify
  COPY . /opt/library
  #CMD ["ionic", "serve", "--all"]
  </code></pre>
  
  <p>And docker-compose.yml:</p>
  
  <pre><code>app:
    build: .
    ports:
      - '8100:8100'
      - '35729:35729'
    volumes:
      - .:/opt/library
      - /opt/library/node_modules
    command: ionic serve --lab
  </code></pre>
  
  <p>Why is it happening? What is missing?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Output of docker-compose build --no-cache</p>
  
  <pre><code>D:\Development\personal_projects\library&gt;docker-compose build --no-cache
  Building app
  Step 1/6 : FROM node:8
   ---&gt; b87c2ad8344d                                                                                                      Step 2/6 : COPY package.json /opt/library/
   ---&gt; 4422d0333b92
  Step 3/6 : WORKDIR /opt/library
  Removing intermediate container 1cfdd60477f9                                                                             ---&gt; 1ca3dc5f5bd6                                                                                                      Step 4/6 : RUN npm install -g cordova ionic &amp;&amp; cordova telemetry off
   ---&gt; Running in d7e9bf4e6d7b
  /usr/local/bin/cordova -&gt; /usr/local/lib/node_modules/cordova/bin/cordova
  /usr/local/bin/ionic -&gt; /usr/local/lib/node_modules/ionic/bin/ionic
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/ionic/node_modules/fsevents):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
  
  + cordova@8.0.0
  + ionic@3.19.1
  added 660 packages in 29.173s
  You have been opted out of telemetry. To change this, run: cordova telemetry on.
  Removing intermediate container d7e9bf4e6d7b
   ---&gt; 3fedee0878af
  Step 5/6 : RUN npm install &amp;&amp; npm cache verify
   ---&gt; Running in 8d482b23f6bb
  &gt; node-sass@4.5.3 install /opt/library/node_modules/node-sass
  &gt; node scripts/install.js
  
  Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/linux-x64-57_binding.node
  Download complete
  Binary saved to /opt/library/node_modules/node-sass/vendor/linux-x64-57/binding.node
  Caching binary to /root/.npm/node-sass/4.5.3/linux-x64-57_binding.node
  
  &gt; uglifyjs-webpack-plugin@0.4.6 postinstall /opt/library/node_modules/uglifyjs-webpack-plugin
  &gt; node lib/post_install.js
  
  
  &gt; node-sass@4.5.3 postinstall /opt/library/node_modules/node-sass
  &gt; node scripts/build.js
  
  Binary found at /opt/library/node_modules/node-sass/vendor/linux-x64-57/binding.node
  Testing binary
  Binary is fine
  npm notice created a lockfile as package-lock.json. You should commit this file.
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
  
  added 548 packages in 30.281s
  Cache verified and compressed (~/.npm/_cacache):
  Content verified: 1476 (55779072 bytes)
  Index entries: 2306
  Finished in 9.736s
  Removing intermediate container 8d482b23f6bb
   ---&gt; 5815e391f2c6
  Step 6/6 : COPY . /opt/library
   ---&gt; 5cc9637a678c
  Successfully built 5cc9637a678c
  Successfully tagged library_app:latest
  
  D:\Development\personal_projects\library&gt;
  </code></pre>
  
  <p>And output of docker-compose up:</p>
  
  <pre><code>D:\Development\personal_projects\library&gt;docker-compose up
  Recreating library_app_1 ... done
  Attaching to library_app_1
           Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser --lab - Ctrl+C to cancel
  app_1  | [14:45:19]  watch started ...
  app_1  | [14:45:19]  build dev started ...
  app_1  | [14:45:19]  clean started ...
  app_1  | [14:45:19]  clean finished in 78 ms
  app_1  | [14:45:19]  copy started ...
  app_1  | [14:45:19]  deeplinks started ...
  app_1  | [14:45:20]  deeplinks finished in 60 ms
  app_1  | [14:45:20]  transpile started ...
  app_1  | [14:45:24]  transpile finished in 4.54 s
  app_1  | [14:45:24]  preprocess started ...
  app_1  | [14:45:24]  preprocess finished in 1 ms
  app_1  | [14:45:24]  webpack started ...
  app_1  | [14:45:24]  copy finished in 5.33 s
  app_1  | [14:45:31]  webpack finished in 6.73 s
  app_1  | [14:45:31]  sass started ...
  app_1  | [14:45:32]  sass finished in 1.46 s
  app_1  | [14:45:32]  postprocess started ...
  app_1  | [14:45:32]  postprocess finished in 40 ms
  app_1  | [14:45:32]  lint started ...
  app_1  | [14:45:32]  build dev finished in 13.64 s
  app_1  | [14:45:32]  watch ready in 13.73 s
  app_1  | [14:45:32]  dev server running: http://localhost:8100/
  app_1  |
           [OK] Development server running!
  app_1  |      Local: http://localhost:8100
  app_1  |      External: http://172.17.0.2:8100
  app_1  |      DevApp: library@8100 on 1643dcb6c0d7
  app_1  |
  app_1  | [14:45:35]  lint finished in 2.51 s
  </code></pre>