commit cafcb70a1f8b55476ff37dadd85d3a3a15f4603d Author: rckrdmrd Date: Sun Jan 4 07:08:05 2026 -0600 Initial commit - betting-analytics-frontend diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cbcfb55 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,42 @@ +# ============================================================================== +# BETTING-ANALYTICS FRONTEND - React Dockerfile +# ============================================================================== +# Multi-stage build for production-ready React application with Nginx +# ============================================================================== + +# Stage 1: Dependencies +FROM node:20-alpine AS deps +WORKDIR /app + +COPY package*.json ./ +RUN npm ci + +# Stage 2: Builder +FROM node:20-alpine AS builder +WORKDIR /app + +COPY --from=deps /app/node_modules ./node_modules +COPY . . + +ARG VITE_API_URL +ARG VITE_WS_URL + +ENV VITE_API_URL=${VITE_API_URL} +ENV VITE_WS_URL=${VITE_WS_URL} + +RUN npm run build + +# Stage 3: Production with Nginx +FROM nginx:alpine AS runner + +COPY nginx.conf /etc/nginx/nginx.conf +COPY --from=builder /app/dist /usr/share/nginx/html + +RUN chown -R nginx:nginx /usr/share/nginx/html + +EXPOSE 80 + +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ + CMD wget --no-verbose --tries=1 --spider http://localhost:80/health || exit 1 + +CMD ["nginx", "-g", "daemon off;"]