FROM node:20-alpine

WORKDIR /app

# Install dependencies as a separate layer so they are cached when only source changes
COPY package.json package-lock.json ./
RUN npm ci

# Source is mounted at runtime via docker-compose volume
# This COPY is only used when building without a volume (e.g. production image)
COPY . .

EXPOSE 5173

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