FROM node:20-alpine

WORKDIR /app

# Paketinfos
COPY package.json ./

# Dependencies installieren (inkl. dev, weil Build Vite + esbuild braucht)
RUN npm install

# Restliches Projekt kopieren
COPY . .

# Production-Build (Front + Server)
RUN npm run build

ENV NODE_ENV=production
ENV PORT=3003

EXPOSE 3003

CMD ["npm", "start"]
