Cesar Mendivil 8b458a3ddf feat: add initial LiveKit Meet integration with utility scripts, configs, and core components
- Add Next.js app structure with base configs, linting, and formatting
- Implement LiveKit Meet page, types, and utility functions
- Add Docker, Compose, and deployment scripts for backend and token server
- Provide E2E and smoke test scaffolding with Puppeteer and Playwright helpers
- Include CSS modules and global styles for UI
- Add postMessage and studio integration utilities
- Update package.json with dependencies and scripts for development and testing
2025-11-20 12:50:38 -07:00

45 lines
1.6 KiB
Docker

# Multi-stage Dockerfile for backend-api
# Build stage: install deps and compile
FROM node:20-bullseye AS builder
WORKDIR /app
# Install build dependencies
COPY package.json package-lock.json* ./
# Try npm ci (fast & reproducible). If package-lock.json is missing, fallback to npm install
RUN apt-get update && apt-get install -y --no-install-recommends python3 build-essential ca-certificates && rm -rf /var/lib/apt/lists/* \
&& (npm ci --no-audit --no-fund || npm install --no-audit --no-fund)
# Copy source and generate Prisma client, then build
COPY . .
# Generate Prisma client so that node_modules/@prisma/client contains the generated client
RUN npx prisma generate --schema=./prisma/schema.prisma || true
# Build the TypeScript project
RUN npm run build
# Remove dev dependencies to leave only production deps (smaller final copy)
# We run npm prune --production which keeps installed production deps in node_modules
RUN npm prune --production || true
# Production stage: copy built files and production deps
FROM node:20-bullseye
WORKDIR /app
# Copy built output
COPY --from=builder /app/dist ./dist
# Copy production node_modules (including generated Prisma client)
COPY --from=builder /app/node_modules ./node_modules
# Copy package.json (useful for runtime metadata)
COPY --from=builder /app/package.json ./package.json
# Copy entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENV NODE_ENV=production
ENV HOST=0.0.0.0
ENV PORT=4000
EXPOSE 4000
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["node", "dist/index.js"]