Spaces:
Paused
Paused
Create Dockerfile
Browse files- Dockerfile +18 -0
Dockerfile
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM golang:1.21-alpine AS builder
|
| 2 |
+
WORKDIR /app
|
| 3 |
+
COPY go.mod go.sum ./
|
| 4 |
+
RUN go mod download
|
| 5 |
+
COPY . .
|
| 6 |
+
RUN CGO_ENABLED=0 GOOS=linux go build -o omniroute .
|
| 7 |
+
|
| 8 |
+
FROM alpine:latest
|
| 9 |
+
RUN apk --no-cache add ca-certificates tzdata
|
| 10 |
+
WORKDIR /app
|
| 11 |
+
COPY --from=builder /app/omniroute .
|
| 12 |
+
|
| 13 |
+
# 锁死 Hugging Face 专属端口
|
| 14 |
+
ENV PORT=7860
|
| 15 |
+
ENV OMNIROUTE_PORT=7860
|
| 16 |
+
EXPOSE 7860
|
| 17 |
+
|
| 18 |
+
CMD ["./omniroute"]
|