FROM node:22

WORKDIR /app

# Copy package files and install dependencies
COPY package*.json ./
RUN npm ci

# Copy .env and source code
COPY .env .
COPY . .

# Expose the dev server port
EXPOSE 8080

# Start the dev server — CORRECT host
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "8080"]
