# ------------------------
# Build stage
# ------------------------
FROM node:22-bullseye AS builder

ARG API_BASE_URL="https://navigolabs.com/api"

WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install ALL dependencies (including devDependencies)
RUN npm install

# Copy source files
COPY . .

# Pass API URL to Vite
ENV VITE_API_BASE_URL=$API_BASE_URL

# Build the app
RUN npm run build
