# Use Node.js 18 FROM node:18-bullseye-slim # Install system libraries required for FFmpeg (just in case static fails) RUN apt-get update && apt-get install -y \ python3 \ build-essential \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Copy package files first (better caching) COPY package*.json ./ # Install dependencies RUN npm install # Copy the rest of the app code COPY . . # Create a directory for permissions and switch to non-root user RUN chown -R 1000:1000 /app USER 1000 # Expose the port Hugging Face expects EXPOSE 7860 ENV PORT=7860 # Start the server CMD ["npm", "start"]