FROM node:18-slim

# Set working directory
WORKDIR /app

# Copy frontend dependencies
COPY frontend/package*.json ./
RUN npm install

# Copy frontend source
COPY frontend/ ./

# Build frontend
RUN npm run build 

# Expose frontend port
EXPOSE 3000

# Start frontend in foreground
CMD ["npm", "start"]