wd23 commited on
Commit
b04f7f6
·
verified ·
1 Parent(s): 0dd278e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -5
Dockerfile CHANGED
@@ -1,12 +1,21 @@
1
- FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
- COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
7
 
8
- COPY app.py .
 
 
 
 
 
 
 
 
 
9
 
10
  EXPOSE 7860
11
 
12
- CMD ["python", "app.py"]
 
1
+ FROM golang:1.21-alpine
2
 
3
  WORKDIR /app
4
 
5
+ # 设置 Go 代理
6
+ ENV GOPROXY=https://goproxy.cn,direct
7
 
8
+ # 复制依赖文件
9
+ COPY go.mod go.sum ./
10
+ RUN go mod download
11
+
12
+ # 复制源代码
13
+ COPY main.go .
14
+ COPY index.html .
15
+
16
+ # 编译
17
+ RUN go build -o hdhive-test main.go
18
 
19
  EXPOSE 7860
20
 
21
+ CMD ["./hdhive-test"]