# Multi-stage Dockerfile: build with Node, serve with Nginx # Build stage FROM node:20-alpine AS builder WORKDIR /app # Install build deps # Copy package files and workspace packages to allow local file:../avanza-ui resolution COPY package.json package-lock.json* ./ # Copy entire monorepo so file: references work (keeps things simple) COPY .. /app WORKDIR /app/packages/studio-panel RUN npm ci --no-audit --no-fund && npm run build # Production stage FROM nginx:stable-alpine # Remove default nginx static RUN rm -rf /usr/share/nginx/html/* # Copy built static files COPY --from=builder /app/packages/studio-panel/dist /usr/share/nginx/html # Copy custom nginx config if provided (optional) # If deploy/nginx.avanzacast.conf exists, use it as default.conf COPY packages/studio-panel/deploy/nginx.avanzacast.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]