Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +36 -35
Dockerfile
CHANGED
|
@@ -1,35 +1,36 @@
|
|
| 1 |
-
FROM oven/bun:latest AS builder
|
| 2 |
-
|
| 3 |
-
WORKDIR /build
|
| 4 |
-
COPY web/package.json .
|
| 5 |
-
COPY web/bun.lock .
|
| 6 |
-
RUN bun install
|
| 7 |
-
COPY ./web .
|
| 8 |
-
COPY ./VERSION .
|
| 9 |
-
RUN DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(cat VERSION) bun run build
|
| 10 |
-
|
| 11 |
-
FROM golang:alpine AS builder2
|
| 12 |
-
|
| 13 |
-
ENV GO111MODULE=on \
|
| 14 |
-
CGO_ENABLED=0 \
|
| 15 |
-
GOOS=linux
|
| 16 |
-
|
| 17 |
-
WORKDIR /build
|
| 18 |
-
|
| 19 |
-
ADD go.mod go.sum ./
|
| 20 |
-
RUN go mod download
|
| 21 |
-
|
| 22 |
-
COPY . .
|
| 23 |
-
COPY --from=builder /build/dist ./web/dist
|
| 24 |
-
RUN go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)'" -o one-api
|
| 25 |
-
|
| 26 |
-
FROM alpine
|
| 27 |
-
|
| 28 |
-
RUN apk upgrade --no-cache \
|
| 29 |
-
&& apk add --no-cache ca-certificates tzdata ffmpeg \
|
| 30 |
-
&& update-ca-certificates
|
| 31 |
-
|
| 32 |
-
COPY --from=builder2 /build/one-api /
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
| 1 |
+
FROM oven/bun:latest AS builder
|
| 2 |
+
|
| 3 |
+
WORKDIR /build
|
| 4 |
+
COPY web/package.json .
|
| 5 |
+
COPY web/bun.lock .
|
| 6 |
+
RUN bun install
|
| 7 |
+
COPY ./web .
|
| 8 |
+
COPY ./VERSION .
|
| 9 |
+
RUN DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(cat VERSION) bun run build
|
| 10 |
+
|
| 11 |
+
FROM golang:alpine AS builder2
|
| 12 |
+
|
| 13 |
+
ENV GO111MODULE=on \
|
| 14 |
+
CGO_ENABLED=0 \
|
| 15 |
+
GOOS=linux
|
| 16 |
+
|
| 17 |
+
WORKDIR /build
|
| 18 |
+
|
| 19 |
+
ADD go.mod go.sum ./
|
| 20 |
+
RUN go mod download
|
| 21 |
+
|
| 22 |
+
COPY . .
|
| 23 |
+
COPY --from=builder /build/dist ./web/dist
|
| 24 |
+
RUN go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)'" -o one-api
|
| 25 |
+
|
| 26 |
+
FROM alpine
|
| 27 |
+
|
| 28 |
+
RUN apk upgrade --no-cache \
|
| 29 |
+
&& apk add --no-cache ca-certificates tzdata ffmpeg \
|
| 30 |
+
&& update-ca-certificates
|
| 31 |
+
|
| 32 |
+
COPY --from=builder2 /build/one-api /
|
| 33 |
+
|
| 34 |
+
EXPOSE 3000
|
| 35 |
+
WORKDIR /data
|
| 36 |
+
ENTRYPOINT ["/one-api"]
|