title: How to serve nodejs app using distroless image in Dockerfile?
body: <p>I am trying to build this example into a distroless image: <a href="https://github.com/docker-hy/frontend-example-docker" rel="nofollow noreferrer">https://github.com/docker-hy/frontend-example-docker</a></p>
  <p>Using vanilla image it would build and run like following:</p>
  <pre><code>FROM node:10
  
  COPY . .  
  
  RUN npm install
  EXPOSE 5000
  CMD [&quot;npm&quot;, &quot;start&quot;]
  </code></pre>
  <p>The following won't work because npm isn't there!</p>
  <pre><code>FROM node:10 AS builder
  COPY . /app
  WORKDIR /app
  RUN npm install
  
  FROM gcr.io/distroless/nodejs:10
  COPY --from=builder /app /app
  WORKDIR /app
  EXPOSE 5000
  CMD [&quot;npm&quot;, &quot;start&quot;]
  </code></pre>
  <p>How do I use distroless images to serve apps like the above example?</p>