- Added a new `api` service for the NestJS backend, including health checks and dependencies on PostgreSQL, Redis, and MinIO. - Introduced PostgreSQL and Redis services with health checks and configurations for data persistence. - Added MinIO for S3-compatible object storage and a one-shot service to initialize required buckets. - Updated the Nginx configuration to proxy requests to the new backend API and MinIO storage. - Enhanced the Dockerfile to support the new API environment variables and configurations. - Updated the `package.json` and `package-lock.json` to include new dependencies for QR code generation and other utilities. Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
874 B
Docker
26 lines
874 B
Docker
FROM node:20-alpine AS builder
|
|
WORKDIR /app
|
|
|
|
# Copy package files first for better caching
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --ignore-scripts
|
|
|
|
# Copy source and build
|
|
COPY . .
|
|
RUN npm run build
|
|
RUN npm prune --production
|
|
|
|
# ── Production image ──────────────────────────────────────────
|
|
FROM node:20-alpine AS production
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/package.json ./package.json
|
|
COPY --from=builder /app/package-lock.json ./package-lock.json
|
|
COPY --from=builder /app/dist ./dist
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
|
|
EXPOSE 4000
|
|
|
|
# Run TypeORM migrations on startup, then start the API
|
|
CMD ["sh", "-c", "npx typeorm migration:run -d dist/database/ormconfig.js 2>/dev/null; export NODE_OPTIONS='--max-old-space-size=1024' && npm run start:prod"]
|