0bba161c12
- Health check endpoint (GET /api/health) with DB probe and uptime - In-memory sliding window rate limiting on login (10/60s) and register (5/3600s) - Structured logging with pino (request timing in hooks, Socket.IO events in server.js) - Site admin dashboard with tenant stats, CRUD, and requireSiteAdmin guard - Tenant admin enhanced with tag and category management UI - Docker HEALTHCHECK in Dockerfile and docker-compose.yml - Backup documentation (docs/backup.md) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
49 lines
937 B
Docker
49 lines
937 B
Docker
# Stage 1: Build
|
|
FROM node:22-alpine AS builder
|
|
|
|
RUN apk add --no-cache python3 make g++
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
|
|
COPY prisma ./prisma
|
|
RUN npx prisma generate
|
|
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Stage 2: Production
|
|
FROM node:22-alpine
|
|
|
|
RUN apk add --no-cache python3 make g++
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --omit=dev
|
|
|
|
COPY prisma ./prisma
|
|
RUN npx prisma generate
|
|
|
|
COPY --from=builder /app/build ./build
|
|
COPY --from=builder /app/server.js ./server.js
|
|
COPY scripts ./scripts
|
|
|
|
RUN apk add --no-cache postgresql-client
|
|
RUN apk del python3 make g++ && rm -rf /var/cache/apk/*
|
|
RUN mkdir -p /app/uploads
|
|
|
|
EXPOSE 3000
|
|
|
|
RUN apk add --no-cache curl
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD curl -f http://localhost:3000/api/health || exit 1
|
|
|
|
COPY docker-entrypoint.sh ./
|
|
RUN chmod +x docker-entrypoint.sh
|
|
|
|
CMD ["./docker-entrypoint.sh"]
|