File size: 549 Bytes
956a293
01e6a7a
47b2811
 
01e6a7a
7bffa9f
01e6a7a
47b2811
01e6a7a
 
47b2811
 
15377ce
47b2811
c18cf88
 
956a293
c18cf88
 
47b2811
956a293
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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"]