FROM node:18-alpine AS build RUN apk add --no-cache \ chromium \ nss \ freetype \ harfbuzz \ ca-certificates \ ttf-freefont WORKDIR /app COPY package*.json ./ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser RUN npm install COPY . /app RUN npm run build FROM node:18-alpine AS prod RUN apk add --no-cache \ chromium \ nss \ freetype \ harfbuzz \ ca-certificates \ ttf-freefont WORKDIR /app RUN mkdir -p /app/export ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser ENV SERVER_PORT=5000 COPY --from=build /app/src/templates /app/src/templates COPY --from=build /app/dist /app/dist COPY --from=build /app/node_modules /app/node_modules COPY --from=build /app/package.json /app/package.json EXPOSE ${SERVER_PORT} CMD [ "npm", "run", "start" ]