veditor_render_server / Dockerfile
3v324v23's picture
fix: install all deps for build then prune
a1231b2
FROM node:20-slim
# Install FFmpeg and Chromium dependencies
RUN apt-get update && apt-get install -y \
ffmpeg \
chromium \
fonts-liberation \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libatspi2.0-0 \
libcups2 \
libdbus-1-3 \
libdrm2 \
libgbm1 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
xdg-utils \
&& rm -rf /var/lib/apt/lists/*
# Set Chromium path for Puppeteer
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
WORKDIR /app
# Install pnpm
RUN npm install -g pnpm
# Copy package files
COPY package*.json ./
# Install ALL dependencies (including devDependencies for build)
RUN pnpm install
# Copy source files
COPY . .
# Build TypeScript
RUN pnpm run build
# Remove devDependencies after build
RUN pnpm prune --prod
# Create directories for videos and jobs
RUN mkdir -p videos jobs
# Expose port 7860 (Hugging Face default)
EXPOSE 7860
# Set environment variables
ENV PORT=7860
ENV NODE_ENV=production
# Start the server
CMD ["pnpm", "start"]