FROM node:20-alpine

WORKDIR /app

COPY package*.json ./
COPY nuxt.config.ts ./
COPY tsconfig.json ./

# Увеличиваем память
ENV NODE_OPTIONS="--max-old-space-size=4096"

RUN npm ci

COPY . .

# Собираем без таймаута
RUN npm run build

EXPOSE 3000

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