# Build stage FROM node:20-alpine as build WORKDIR /app # Copy package files and install dependencies COPY package*.json ./ RUN npm install # Copy source code and build COPY . . RUN npm run build # Production stage FROM nginx:alpine # Remove default nginx static assets RUN rm -rf /usr/share/nginx/html/* # Copy built artifacts to /serial subdirectory to match base path COPY --from=build /app/dist /usr/share/nginx/html/serial # Copy custom nginx configuration COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]