FROM node:20-alpine # 安装 git 以及运行、编译 SQLite 必须的原生 Linux 依赖包 RUN apk add --no-cache git python3 make g++ sqlite sqlite-dev WORKDIR /app # 1. 抓取源码 RUN git clone https://github.com/diegosouzapw/OmniRoute.git . # 2. 强行在安装依赖时触发 better-sqlite3 针对当前 Linux 环境的现场编译 RUN npm install --include=dev # 锁死 Hugging Face 专属端口 ENV PORT=7860 ENV OMNIROUTE_PORT=7860 ENV HOST=0.0.0.0 EXPOSE 7860 # 3. 继续用免编译的开发模式启动 CMD ["npm", "run", "dev"]