AvanzaCast/deploy/token-server.Dockerfile
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

42 lines
1.3 KiB
Docker

# Dockerfile para token-server (multi-stage)
# Construye una imagen ligera que ejecute el token server en Node.js
# Builder: install deps y preparar archivos
FROM node:20-alpine AS builder
WORKDIR /app
# Instalar herramientas de construcción
RUN apk add --no-cache python3 make g++ bash
# Copiar archivos del paquete token-server e instalar dependencias
COPY packages/token-server/package.json packages/token-server/package-lock.json* ./
# Usar npm ci si existe package-lock; de lo contrario, usar npm install
RUN if [ -f package-lock.json ]; then \
npm ci --silent || (npm install --silent --legacy-peer-deps); \
else \
npm install --silent --legacy-peer-deps; \
fi
# Copiar el código fuente del token-server
COPY packages/token-server ./
# No se requiere paso de construcción para este servidor simple (es JavaScript puro)
# Runtime: imagen mínima con dependencias de producción y código fuente
FROM node:20-alpine AS runtime
WORKDIR /app
# Copiar node_modules instalados del builder al runtime
COPY --from=builder /app/node_modules ./node_modules
# Copiar archivos fuente
COPY --from=builder /app/src ./src
COPY --from=builder /app/package.json ./package.json
ENV NODE_ENV=production
ENV PORT=4000
EXPOSE 4000
# Ejecutar el servidor (el token-server usa src/index.js)
CMD ["node", "src/index.js"]