# Stage 1: Build FROM oven/bun:1 AS build WORKDIR /app COPY package.json bun.lock ./ RUN bun install --frozen-lockfile COPY . . ARG VITE_NKODE_API_URL=https://api.nkode.donovankelly.xyz ENV VITE_NKODE_API_URL=$VITE_NKODE_API_URL RUN bun run build # Stage 2: Serve FROM nginx:alpine COPY --from=build /app/dist /usr/share/nginx/html # SPA routing: all paths → index.html RUN printf 'server {\n listen 80;\n root /usr/share/nginx/html;\n index index.html;\n location / {\n try_files $uri $uri/ /index.html;\n }\n}\n' > /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]