FROM node:20-slim # Install HandBrakeCLI and font dependencies RUN apt-get update && apt-get install -y \ handbrake-cli \ wget \ fontconfig \ fonts-noto \ && rm -rf /var/lib/apt/lists/* # Install Noto Sans Sinhala font RUN mkdir -p /usr/share/fonts/noto-sinhala \ && wget -q "https://raw.githubusercontent.com/Super-Chama/Noto-Sans-Sinhala/refs/heads/master/TTF/NotoSansSinhala-Bold.ttf" \ -O /usr/share/fonts/noto-sinhala/NotoSansSinhala.ttf \ && fc-cache -fv # Install Roboto font RUN mkdir -p /usr/share/fonts/roboto \ && wget -q "https://raw.githubusercontent.com/akurapluz/sinhala-fonts/refs/heads/main/Roboto-Regular.ttf" \ -O /usr/share/fonts/roboto/Roboto-Regular.ttf \ && wget -q "https://raw.githubusercontent.com/akurapluz/sinhala-fonts/refs/heads/main/Roboto-Bold.ttf" \ -O /usr/share/fonts/roboto/Roboto-Bold.ttf \ && fc-cache -fv WORKDIR /app COPY package*.json ./ RUN npm install --production COPY . . # HuggingFace Spaces runs as non-root user 1000 RUN mkdir -p /app/uploads /app/output \ && chmod -R 777 /app/uploads /app/output EXPOSE 7860 ENV PORT=7860 ENV NODE_ENV=production CMD ["node", "server.js"]