FROM node:20-alpine

WORKDIR /app

# Instalar dependencias de sistema para Prisma
RUN apk add --no-cache openssl

COPY package*.json ./
RUN npm ci

COPY . .

RUN npx prisma generate

EXPOSE ${PORT:-4000}

CMD ["npm", "run", "dev"]
