FROM node:22-slim # Set up a working directory WORKDIR /app # Copy dependency files COPY package*.json ./ # Install PeerJS RUN npm install --omit=dev # Run as non-root user USER node # Expose port 7860 (Hugging Face default) EXPOSE 7860 # Start PeerJS on root path "/" with proxy support and timeouts CMD ["npx", "peerjs", "--port", "7860", "--path", "/", "--proxied", "true", "--expire_timeout", "5000", "--alive_timeout", "60000"]