FROM node:20-alpine AS builder
WORKDIR /app/website

COPY package.json package-lock.json ./
RUN npm ci

COPY . ./
RUN npm run build

FROM node:20-alpine AS runner
WORKDIR /app/website
ENV NODE_ENV=production
ENV NUXT_HOST=0.0.0.0
ENV NUXT_PORT=3000

COPY --from=builder /app/website/.output ./.output

EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]
