FROM node:16 as build-stage WORKDIR /app RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm # Files required by pnpm install COPY .npmrc package.json pnpm-lock.yaml ./ RUN pnpm install --frozen-lockfile --prod RUN pnpm install esbuild # Bundle app source COPY . . RUN pnpm build # production stage FROM nginx:stable-alpine as production-stage COPY --from=build-stage /app/dist /usr/share/nginx/html COPY --from=build-stage /app/nginx/default.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]