mirror of
https://github.com/recklessop/zroc.git
synced 2026-07-03 05:23:13 -04:00
0500ac171c
- 61 files across zroc-ui/ and zroc-ova/ directories - Full content written for: config, auth, API layers, CSS, build files, OVA scripts, backend routes, charts, hooks, constants - Stubs in place for: page components, Sidebar, TopBar, docker-compose, authentik client, blueprint YAML, packer HCL, workflows, setup wizard Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
43 lines
1.0 KiB
Docker
43 lines
1.0 KiB
Docker
# Stage 1: Build the React SPA
|
|
FROM node:20-alpine AS frontend-builder
|
|
|
|
WORKDIR /build/frontend
|
|
|
|
COPY package.json package-lock.json* ./
|
|
RUN npm ci --prefer-offline
|
|
|
|
COPY index.html vite.config.js tailwind.config.js postcss.config.js ./
|
|
COPY src/ ./src/
|
|
RUN npm run build
|
|
|
|
# Stage 2: Install backend production dependencies
|
|
FROM node:20-alpine AS backend-builder
|
|
|
|
WORKDIR /build/backend
|
|
|
|
COPY backend/package.json backend/package-lock.json* ./
|
|
RUN npm ci --omit=dev --prefer-offline
|
|
|
|
# Stage 3: Production image
|
|
FROM node:20-alpine AS production
|
|
|
|
RUN addgroup -S zroc && adduser -S zroc -G zroc
|
|
|
|
WORKDIR /app
|
|
|
|
COPY backend/ ./backend/
|
|
COPY --from=backend-builder /build/backend/node_modules ./backend/node_modules
|
|
COPY --from=frontend-builder /build/frontend/dist ./dist
|
|
|
|
RUN mkdir -p /app/data && chown zroc:zroc /app/data
|
|
VOLUME ["/app/data"]
|
|
|
|
USER zroc
|
|
|
|
EXPOSE 3001
|
|
|
|
HEALTHCHECK --interval=15s --timeout=5s --start-period=30s --retries=3 \
|
|
CMD wget -qO- http://localhost:3001/api/health || exit 1
|
|
|
|
CMD ["node", "backend/server.js"]
|