mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-04 22:07:14 +01:00
Test coverage section was stale (2581/92 → 7353/497). Rewrote the Testing Coverage section to reflect the full API route coverage sprint and all lib/config/schema test suites added since 2026-05-01. Also tracks cms-api source files (Dockerfile, auth utility, migration) that were untracked since the CMS backend was scaffolded. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
45 lines
881 B
Docker
45 lines
881 B
Docker
# RevampIT CMS API Dockerfile
|
|
FROM node:18-alpine
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies for PostgreSQL
|
|
RUN apk add --no-cache postgresql-client curl
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
# Install all deps to build TypeScript, then prune to production
|
|
RUN npm ci && npm cache clean --force
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Create uploads directory
|
|
RUN mkdir -p uploads
|
|
|
|
# Build TypeScript
|
|
RUN npm run build && npm prune --production
|
|
|
|
# Create non-root user
|
|
RUN addgroup -g 1001 -S nodejs
|
|
RUN adduser -S cmsuser -u 1001
|
|
|
|
# Change ownership of app directory
|
|
RUN chown -R cmsuser:nodejs /app
|
|
USER cmsuser
|
|
|
|
# Expose port
|
|
EXPOSE 3001
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD curl -fsS http://localhost:3001/health || exit 1
|
|
|
|
# Start the application
|
|
CMD ["npm", "start"]
|
|
|
|
|