FROM node:20-slim # Install system dependencies + native addon build tools RUN apt-get update && apt-get install -y \ git \ curl \ python3 \ make \ g++ \ && rm -rf /var/lib/apt/lists/* WORKDIR /app RUN git clone https://github.com/decolua/9router.git . RUN npm install RUN npm run build # Optional: remove build tools after build to reduce image size RUN apt-get purge -y --auto-remove python3 make g++ RUN mkdir -p /data /root/.9router ENV PORT=7860 ENV HOSTNAME=0.0.0.0 ENV NODE_ENV=production ENV DATA_DIR=/data ENV INITIAL_PASSWORD=changeme123 ENV JWT_SECRET=please-change-this-jwt-secret-in-hf-spaces-settings ENV API_KEY_SECRET=please-change-this-api-key-secret ENV MACHINE_ID_SALT=please-change-this-salt ENV REQUIRE_API_KEY=false ENV AUTH_COOKIE_SECURE=true ENV ENABLE_REQUEST_LOGS=false EXPOSE 7860 COPY start-hf.sh /app/start-hf.sh RUN chmod +x /app/start-hf.sh CMD ["/app/start-hf.sh"]