title: Vue (NPM) + NGINX in a single docker
body: <p>Quite recently I have found many websites proposing solution to encapsulate a NPM and NGINX into a single dockerfile using so-called: &quot;multi-stages&quot; docker.</p>
  <pre><code>
  # first stage builds vue 
  FROM mhart/alpine-node:12 as build-stage
  WORKDIR /app
  COPY . .
  RUN npm ci 
  RUN npm run build 
  
  # second stage copies only the static dist files to nginx html dir
  FROM nginx:stable-alpine as production-stage
  VOLUME /var/log/nginx
  COPY nginx.conf /etc/nginx/conf.d/default.conf
  COPY --from=build-stage /app/dist /usr/share/nginx/html
  EXPOSE 8080
  CMD [&quot;nginx&quot;, &quot;-g&quot;, &quot;daemon off;&quot;]
  </code></pre>
  <p>But it's not clear to me. After all, docker should host only one process, while in the examples in question it runs the NPM server and separately NGINX - am I reading these instructions in the Dockerfile correctly?</p>
  <p>Isn't it more reasonable to take a &quot;side-car&quot; approach when hosting this on a service like Kubernetes or AWS ECS?</p>