sanbo1200 commited on
Commit
4367287
·
verified ·
1 Parent(s): 83bfd5a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -14
Dockerfile CHANGED
@@ -1,15 +1,26 @@
1
- # FROM golang:1.23-alpine AS builder
2
- # WORKDIR /app
3
- # COPY go.mod go.sum ./
4
- # RUN go mod download
5
- # COPY . .
6
- # RUN CGO_ENABLED=0 go build -o main .
7
-
8
- # FROM alpine:latest
9
- # RUN apk --no-cache add ca-certificates
10
- # WORKDIR /app
11
- # COPY --from=builder /app/main .
12
- # # EXPOSE 8080
13
- # CMD ["./main"]
14
- FROM ghcr.io/hhhaiai/z2-amd64:latest
 
 
 
 
 
 
 
 
 
 
 
15
 
 
1
+ # Build stage
2
+ FROM golang:1.23-alpine AS builder
3
+ WORKDIR /app
4
+ COPY go.mod go.sum ./
5
+ RUN go mod download
6
+ COPY . .
7
+ RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
8
+
9
+ # Final stage
10
+ FROM alpine:latest
11
+ RUN apk --no-cache add ca-certificates tzdata
12
+ WORKDIR /app
13
+ COPY --from=builder /app/main .
14
+
15
+ # Labels
16
+ LABEL maintainer="Z2"
17
+ LABEL description="Z2 兼容API代理"
18
+ LABEL version="1.0.2"
19
+
20
+ # Expose port
21
+ EXPOSE 7860
22
+
23
+ # Run the application
24
+ CMD ["./main"]
25
+ # FROM ghcr.io/hhhaiai/z2-amd64:latest
26