# Use Gotenberg 8 as the base FROM gotenberg/gotenberg:latest USER root # Install Node.js and image extraction tools (Poppler, WebP, AVIF) RUN apt-get update -qq && \ apt-get install -y -qq curl poppler-utils webp libavif-bin && \ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y -qq nodejs && \ apt-get clean && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy application files COPY package.json . RUN npm install COPY server.js . # Grant permissions for the Gotenberg user to write temp files RUN chown -R gotenberg:gotenberg /app && chmod -R 777 /tmp USER gotenberg # Expose Hugging Face's required port EXPOSE 7860 # Start Gotenberg on an internal port (3000), and our Node API on 7860 CMD gotenberg --api-port=3000 & node server.js