FROM node:20-alpine
WORKDIR /app
RUN apk add --no-cache git openssl
RUN npm install -g pnpm@9
COPY . .
RUN pnpm install --frozen-lockfile
RUN pnpm --filter @rps-royale/shared build
RUN pnpm --filter @rps-royale/server db:generate
RUN pnpm --filter @rps-royale/server build
ENV NODE_ENV=production
EXPOSE 3001
CMD ["node", "apps/server/dist/index.js"]
