Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +2 -21
Dockerfile
CHANGED
@@ -1,23 +1,4 @@
|
|
1 |
-
FROM
|
2 |
-
|
3 |
-
WORKDIR /build
|
4 |
-
RUN git clone https://github.com/MartialBE/one-api.git .
|
5 |
-
|
6 |
-
WORKDIR /build/web
|
7 |
-
RUN npm install
|
8 |
-
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat ../VERSION) npm run build
|
9 |
-
|
10 |
-
FROM golang AS builder2
|
11 |
-
|
12 |
-
ENV GO111MODULE=on \
|
13 |
-
CGO_ENABLED=1 \
|
14 |
-
GOOS=linux
|
15 |
-
|
16 |
-
WORKDIR /build
|
17 |
-
|
18 |
-
COPY --from=builder /build ./
|
19 |
-
RUN go mod download
|
20 |
-
RUN go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o one-api
|
21 |
|
22 |
FROM --platform=$BUILDPLATFORM caddy:2.6.2-alpine AS runner
|
23 |
|
@@ -26,7 +7,7 @@ RUN apk update \
|
|
26 |
&& apk add --no-cache ca-certificates tzdata \
|
27 |
&& update-ca-certificates 2>/dev/null || true
|
28 |
|
29 |
-
COPY --from=
|
30 |
|
31 |
WORKDIR /data
|
32 |
|
|
|
1 |
+
FROM ghcr.io/martialbe/one-api as builder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
FROM --platform=$BUILDPLATFORM caddy:2.6.2-alpine AS runner
|
4 |
|
|
|
7 |
&& apk add --no-cache ca-certificates tzdata \
|
8 |
&& update-ca-certificates 2>/dev/null || true
|
9 |
|
10 |
+
COPY --from=builder /one-api /usr/local/bin/one-api
|
11 |
|
12 |
WORKDIR /data
|
13 |
|