FROM node:lts AS builder
WORKDIR /app
ENV NODE_OPTIONS=--openssl-legacy-provider
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:lts-slim AS runtime
WORKDIR /app
# Copy built artifact from the builder stage
COPY --from=builder /app/dayjs.min.js /dayjs.min.js
COPY --from=builder /app/dayjs.min.js /app/dayjs.min.js
# Simple smoke test at startup to verify artifact exists
CMD ["sh","-lc","[ -f /dayjs.min.js ] && echo dayjs.min.js exists || echo missing dayjs.min.js"]