Initial commit: CRDC Arrests API demo app
Deploy to Git Pages / build-and-deploy (push) Failing after 19s
Deploy to Git Pages / build-and-deploy (push) Failing after 19s
React + Vite static site demonstrating the CRDC School Arrest Rate API. Features 6 interactive charts comparing observed arrest data against Bayesian model estimates across U.S. school districts, with Civilytics visual identity. - State selector and district search with 'interesting' suggestions (top arrests) - Animated histogram loading grid showing posterior draw progress - Charts: time series, rate by group, district vs national, model comparison quadrants, density proxy, exceedance probability - Static JSON fixture for national rates (no API changes needed) - Dockerfile + docker-compose.yml for self-hosted deployment - GitHub Actions workflow and _config.yml for Git Pages
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
# Multi-stage build for the CRDC Arrests API Demo app.
|
||||
# Stage 1: Build static files with Vite + React
|
||||
FROM node:22-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci --prefer-offline
|
||||
|
||||
COPY . .
|
||||
# The VITE_API_BASE env var can be set at build time to point to a different API endpoint.
|
||||
ARG VITE_API_BASE=https://crdc-api.civilytics.org/api/v1
|
||||
ENV VITE_API_BASE=${VITE_API_BASE}
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Serve with nginx (tiny image, ~5MB)
|
||||
FROM nginx:alpine AS runtime
|
||||
COPY --from=builder /app/dist/ /usr/share/nginx/html/
|
||||
# Custom nginx config for SPA routing + caching headers
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user