# Dockerfile for Synor Web Wallet # Multi-stage build for optimized production image # Stage 1: Build FROM node:20-alpine AS builder WORKDIR /app # Install dependencies COPY package.json ./ RUN npm install # Copy source and build COPY . . RUN npm run build # Stage 2: Serve with nginx FROM nginx:alpine AS production # Copy build output COPY --from=builder /app/dist /usr/share/nginx/html # Copy custom nginx config for SPA routing RUN echo 'server { \ listen 80; \ root /usr/share/nginx/html; \ index index.html; \ location / { \ try_files $uri $uri/ /index.html; \ } \ location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { \ expires 1y; \ add_header Cache-Control "public, immutable"; \ } \ }' > /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]