javaeeduke commited on
Commit
b73e1d5
·
verified ·
1 Parent(s): c3eddd0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -21
Dockerfile CHANGED
@@ -1,4 +1,3 @@
1
- # --- 第一阶段:让云端去 GitHub 抓代码并编译 ---
2
  FROM golang:1.21-alpine AS builder
3
 
4
  # 安装 git
@@ -9,24 +8,8 @@ WORKDIR /app
9
  # 1. 拉取代码
10
  RUN git clone https://github.com/diegosouzapw/OmniRoute.git .
11
 
12
- # 2. 修正刚错的命令,并在根目录执行 go mod tidy
13
- RUN go mod init omniroute && go mod tidy || true
14
 
15
- # 3. 【核心修复】使用 ./... 自动寻找子目录下的入口文件进递归编译
16
- RUN CGO_ENABLED=0 GOOS=linux go build -o omniroute ./...
17
-
18
- # --- 第二阶段:极简运行环境 ---
19
- FROM alpine:latest
20
- RUN apk --no-cache add ca-certificates tzdata
21
- WORKDIR /app
22
-
23
- # 把第一阶段编译好的程序搬过来
24
- COPY --from=builder /app/omniroute .
25
-
26
- # 锁死 Hugging Face 专属端口
27
- ENV PORT=7860
28
- ENV OMNIROUTE_PORT=7860
29
- EXPOSE 7860
30
-
31
- # 启动微服务
32
- CMD ["./omniroute"]
 
 
1
  FROM golang:1.21-alpine AS builder
2
 
3
  # 安装 git
 
8
  # 1. 拉取代码
9
  RUN git clone https://github.com/diegosouzapw/OmniRoute.git .
10
 
11
+ # 2. 【核心排查】强制印出克隆来的所有文件和文件夹结构
12
+ RUN echo "=== 开始查看仓库文件结构 ===" && ls -R /app && echo "=== 查看结束 ==="
13
 
14
+ # 3. 随便写一让它中断,方便我们看上面的日志
15
+ RUN exit 1