FROM node:20-alpine WORKDIR /app # Install backend deps COPY package*.json ./ RUN npm install --production # Build frontend COPY client/package*.json ./client/ RUN cd client && npm install COPY client/ ./client/ RUN cd client && npm run build # Copy backend source COPY server.js db.js migrate.js ./ COPY routes/ ./routes/ # Run migrations then start server CMD node migrate.js && node server.js