title: Unable to Dockerize Vite React-Typescript Project
body: <p>I am trying to dockerize a Vite React-Typescript boilerplate setup, but I unable to connect to the container.</p>
  <p>Installed vite-react-typescript boilerplate:</p>
  <p><code>npm init vite@latest vite-docker-demo -- --template react-ts</code></p>
  <p><strong>Dockerfile</strong></p>
  <pre><code># Declare the base image
  FROM node:lts-alpine3.14
  # Build step
  # 1. copy package.json and package-lock.json to /app dir
  RUN mkdir /app
  COPY package*.json /app
  # 2. Change working directory to newly created app dir
  WORKDIR /app
  # 3 . Install dependencies
  RUN npm ci
  # 4. Copy the source code to /app dir
  COPY . .
  # 5. Expose port 3000 on the container
  EXPOSE 3000
  # 6. Run the app
  CMD [&quot;npm&quot;, &quot;run&quot;, &quot;dev&quot;]
  </code></pre>
  <p>Command to run docker container in detached mode and open local dev port 3000 on host:
  <code>docker run -d -p 3000:3000 vite</code></p>
  <p>The vite instance seems to be running just fine within the container (docker logs output):</p>
  <pre><code>&gt; vite-docker@0.0.0 dev /app
  &gt; vite
  
  Pre-bundling dependencies:
    react
    react-dom
  (this will be run only when your dependencies or config have changed)
  
    vite v2.4.4 dev server running at:
  
    &gt; Local: http://localhost:3000/
    &gt; Network: use `--host` to expose
  
    ready in 244ms.
  </code></pre>
  <p>However, when I navigate to <code>http://localhost:3000/</code> within Chrome. I see an error indicating <code>The connection was reset</code>.</p>
  <p>Any help resolving this issue would be greatly appreciated!</p>