# Build stage FROM node:20-alpine AS builder WORKDIR /app # Copy package files COPY package*.json ./ # Install dependencies RUN npm ci # Cache-bust: change CACHEBUST value in docker-compose.yml to force rebuild ARG CACHEBUST=1 # Copy source code COPY . . # ── Build-time configuration via ARGs ──────────────────────── # These are baked into the static JS bundle at build time. # Override them with docker-compose build.args or --build-arg. ARG VITE_NOSTR_RELAYS="" ARG VITE_USE_MOCK_DATA=false ARG VITE_CONTENT_ORIGIN= ARG VITE_INDEEHUB_API_URL=/api ARG VITE_INDEEHUB_CDN_URL=/storage ENV VITE_NOSTR_RELAYS=${VITE_NOSTR_RELAYS} ENV VITE_USE_MOCK_DATA=${VITE_USE_MOCK_DATA} ENV VITE_CONTENT_ORIGIN=${VITE_CONTENT_ORIGIN} ENV VITE_INDEEHUB_API_URL=${VITE_INDEEHUB_API_URL} ENV VITE_INDEEHUB_CDN_URL=${VITE_INDEEHUB_CDN_URL} # Build the application RUN npm run build # Production stage FROM nginx:alpine # Install curl for health checks RUN apk add --no-cache curl # Copy custom nginx config COPY nginx.conf /etc/nginx/conf.d/default.conf # Copy built assets from builder stage COPY --from=builder /app/dist /usr/share/nginx/html # Expose port 7777 EXPOSE 7777 # Start nginx CMD ["nginx", "-g", "daemon off;"]