FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json* ./
COPY apps/admin/package.json apps/admin/package.json
RUN npm install

FROM deps AS build
COPY . .
RUN npm run build --workspace @fedeo/push-admin

FROM node:22-alpine
WORKDIR /app
ENV NODE_ENV=production
COPY --from=build /app/apps/admin/.output ./.output
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]
