FROM node:20-alpine AS builder WORKDIR /app ENV NPM_CONFIG_REGISTRY=https://registry.npmmirror.com ENV NODE_OPTIONS=--max-old-space-size=4096 COPY package.json yarn.lock ./ RUN yarn install COPY . . RUN yarn build FROM nginx:1.27-alpine RUN apk add --no-cache openssl COPY nginx.conf /etc/nginx/conf.d/default.conf COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh COPY --from=builder /app/dist /usr/share/nginx/html EXPOSE 80 443 ENTRYPOINT ["/entrypoint.sh"]