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