title: VueJS Nginx and docker set up - Local ERR_EMPTY_RESPONSE
body: <p>This is my first time using Docker so apologies if this drives you mad when reading this.</p>
  <p>I'm currently attempting to dockerise my Vue application with Nginx and a dev container (Neither works at the moment)</p>
  <p>I have been going endlessly around tutorials but keep going round in circles as my folder structure is not the same so I keep getting this <code>OSError: [Errno 22] Invalid argument: '\\?\D:\GitHub\RepoName\website\node_modules\.bin\acorn'</code> error</p>
  <p>The structure of my environment is currently (And cannot be changed!)</p>
  <pre><code>RepoName
    - Docker-Compose
         - website
            - Vue Application (Build, src, static, node modules)
             -Dockerfile (Moved from Docker-Setup/Website)
             -Nginx Conf (Moved from Docker-Setup/Website)
  
  </code></pre>
  <p><strong>Docker-Compose</strong></p>
  <pre><code> website:
          container_name: tutorial
          image: nginx:1.17
          build:
              context: ./website
          volumes:
              - ./website:/app
              - ./app/node_modules
          ports:
              - &quot;8080:80&quot;
  
  </code></pre>
  <p>As you can see when building it calls the Dockerfile in <code>./website</code></p>
  <pre><code>#Docker file for VueJS using NGINX
  # build stage
  FROM node:lts-alpine as build-stage
  WORKDIR /app
  COPY package*.json ./
  RUN apk add --update npm
  RUN npm install @vue/cli@3.7.0 -g
  RUN npm install
  COPY . /app
  RUN npm run build
  
  # production stage
  FROM nginx:stable-alpine as production-stage
  
  COPY --from=build-stage . /usr/share/nginx/html
  RUN rm /etc/nginx/conf.d/default.conf
  COPY nginx.conf /etc/nginx/conf.d
  
  ENV PORT = 8080
  EXPOSE 8080
  CMD [&quot;nginx&quot;, &quot;-g&quot;, &quot;daemon off;&quot;]
  
  
  
  </code></pre>
  <p>My Nginx conf if required (Copied from VueJS Docker set up)</p>
  <pre><code>server {
  
    listen 8080;
  
    location / {
      root   /usr/share/nginx/html/app;
      index  index.html index.htm;
      try_files $uri $uri/ /index.html;
    }
  
    error_page   500 502 503 504  /50x.html;
  
    location = /50x.html {
      root   /usr/share/nginx/html;
    }
  
  }
  </code></pre>
  <p><strong>Errors:</strong></p>
  <blockquote>
  <p>OSError: [Errno 22] Invalid argument:
  '\\?\D:\GitHub\RepoName\website\node_modules\.bin\acorn'</p>
  </blockquote>
  <p>During handling of the above exception, another exception occurred:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;docker-compose&quot;, line 3, in &lt;module&gt;
    File &quot;compose\cli\main.py&quot;, line 67, in main
    File &quot;compose\cli\main.py&quot;, line 126, in perform_command
    File &quot;compose\cli\main.py&quot;, line 1070, in up
    File &quot;compose\cli\main.py&quot;, line 1066, in up
    File &quot;compose\project.py&quot;, line 615, in up
    File &quot;compose\service.py&quot;, line 346, in ensure_image_exists
    File &quot;compose\service.py&quot;, line 1125, in build
    File &quot;site-packages\docker\api\build.py&quot;, line 160, in build
    File &quot;site-packages\docker\utils\build.py&quot;, line 31, in tar
    File &quot;site-packages\docker\utils\build.py&quot;, line 100, in create_archive
  OSError: Can not read file in context: \\?\D:\GitHub\RepoName\website\node_modules\.bin\acorn
  [16788] Failed to execute script docker-compose
  </code></pre>
  <p><strong>Update</strong></p>
  <p>Fixed Node Issue (I think) by adding it to <code>.dockerignore</code></p>
  <p>Now getting:</p>
  <pre><code>Error: Cannot find module '/app/build/build.js'
      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
      at Function.Module._load (internal/modules/cjs/loader.js:687:27)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
      at internal/main/run_main_module.js:17:47 {
    code: 'MODULE_NOT_FOUND',
    requireStack: []
  }
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! project@1.0.0 build: `node build/build.js`
  npm ERR! Exit status 1
  npm ERR!
  npm ERR! Failed at the project@1.0.0 build script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /root/.npm/_logs/2020-10-12T10_36_28_384Z-debug.log
  </code></pre>
  <p>Fixed that issue now, now onto the next one...</p>
  <pre><code>ERROR in   Error: Child compilation failed:
    Entry module not found: Error: Can't resolve '/app/index.html' in '/app':
    Error: Can't resolve '/app/index.html' in '/app'
  
    - compiler.js:76
      [app]/[html-webpack-plugin]/lib/compiler.js:76:16
  
    - Compiler.js:300
      [app]/[webpack]/lib/Compiler.js:300:11
  
    - Compiler.js:510
      [app]/[webpack]/lib/Compiler.js:510:14
  
    - Tapable.js:202 next
      [app]/[tapable]/lib/Tapable.js:202:11
  
    - CachePlugin.js:78 Compiler.&lt;anonymous&gt;
      [app]/[webpack]/lib/CachePlugin.js:78:5
  
    - Tapable.js:206 Compiler.applyPluginsAsyncSeries
      [app]/[tapable]/lib/Tapable.js:206:13
  
    - Compiler.js:507
      [app]/[webpack]/lib/Compiler.js:507:11
  
    - Tapable.js:195 Compilation.applyPluginsAsyncSeries
      [app]/[tapable]/lib/Tapable.js:195:46
  
    - Compilation.js:683
      [app]/[webpack]/lib/Compilation.js:683:19
  
    - Tapable.js:202 next
      [app]/[tapable]/lib/Tapable.js:202:11
  
    - index.js:126 LastCallWebpackPlugin.process
      [app]/[last-call-webpack-plugin]/index.js:126:12
  
    - index.js:197 Compilation.&lt;anonymous&gt;
      [app]/[last-call-webpack-plugin]/index.js:197:12
  
    - Tapable.js:206 Compilation.applyPluginsAsyncSeries
      [app]/[tapable]/lib/Tapable.js:206:13
  
    - Compilation.js:674
      [app]/[webpack]/lib/Compilation.js:674:11
  
    - Tapable.js:202 next
      [app]/[tapable]/lib/Tapable.js:202:11
  
    - index.js:126 LastCallWebpackPlugin.process
      [app]/[last-call-webpack-plugin]/index.js:126:12
  
  
  
    Build failed with errors.
  
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! project@1.0.0 build: `node build/build.js`
  npm ERR! Exit status 1
  npm ERR!
  npm ERR! Failed at the project@1.0.0 build script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /root/.npm/_logs/2020-10-12T11_35_40_116Z-debug.log
  </code></pre>
  <p>Fixed that issue now by pretty much re-installing vue (I deleted the index.html file when trying to get it set up...)</p>
  <p>Now I'm getting (Updated my docker-compose, nginx and dockerfile to reflect this)</p>
  <pre><code>```
  This page isn’t working localhost didn’t send any data.
  ERR_EMPTY_RESPONSE
  ```
  </code></pre>