Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +2 -6
Dockerfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
FROM node:16 as builder
|
2 |
|
3 |
WORKDIR /build
|
4 |
-
RUN git clone https://github.com/MartialBE/one-
|
5 |
RUN wget -qO- -t1 -T2 "https://api.github.com/repos/MartialBE/one-hub/releases" | \
|
6 |
grep "tag_name" | \
|
7 |
head -n 1 | \
|
@@ -22,12 +22,8 @@ ENV GO111MODULE=on \
|
|
22 |
GOOS=linux
|
23 |
|
24 |
WORKDIR /build
|
25 |
-
|
26 |
-
RUN sed -i'' 's|router.Group("/v1|router.Group("/api/v1|g' /build/router/relay-router.go
|
27 |
-
RUN sed -i'' 's|HasPrefix(path, "/v1|HasPrefix(path, "/api/v1|g' /build/relay/common.go
|
28 |
-
|
29 |
RUN go mod download
|
30 |
-
COPY --from=builder /build/web/build ./web/build
|
31 |
RUN go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o one-api
|
32 |
|
33 |
FROM alpine
|
|
|
1 |
FROM node:16 as builder
|
2 |
|
3 |
WORKDIR /build
|
4 |
+
RUN git clone https://github.com/MartialBE/one-hub.git .
|
5 |
RUN wget -qO- -t1 -T2 "https://api.github.com/repos/MartialBE/one-hub/releases" | \
|
6 |
grep "tag_name" | \
|
7 |
head -n 1 | \
|
|
|
22 |
GOOS=linux
|
23 |
|
24 |
WORKDIR /build
|
25 |
+
COPY --from=builder /build .
|
|
|
|
|
|
|
26 |
RUN go mod download
|
|
|
27 |
RUN go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o one-api
|
28 |
|
29 |
FROM alpine
|