# Dockerfile untuk SPA Nuxt 3
FROM node:24-alpine AS builder

WORKDIR /app

COPY package*.json ./
RUN npm install --legacy-peer-deps

COPY . .

RUN npm run build

# Dockerfile untuk server Nuxt 3
FROM node:24-alpine

WORKDIR /app

RUN npm install -g serve

COPY --from=builder /app/.output ./output
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package*.json ./


EXPOSE 3000

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