Update Dockerfile
Browse files1234567891011121314151617181920212223242526272829303132333435363738FROM node:16 as builderWORKDIR /buildRUN git clone https://github.com/MartialBE/one-api.git .RUN sed -i'' 's|router.Group("/v1|router.Group("/api/v1|g' /build/router/relay-router.goRUN sed -i'' 's|HasPrefix(path, "/v1|HasPrefix(path, "/api/v1|g' /build/relay/common.goWORKDIR /build/webRUN npm installRUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat ../VERSION) npm run buildFROM golang AS builder2ENV GO111MODULE=on \CGO_ENABLED=1 \GOOS=linuxWORKDIR /buildRUN git clone https://github.com/MartialBE/one-api.git .RUN sed -i'' 's|router.Group("/v1|router.Group("/api/v1|g' /build/router/relay-router.goRUN sed -i'' 's|HasPrefix(path, "/v1|HasPrefix(path, "/api/v1|g' /build/relay/common.goRUN go mod downloadCOPY --from=builder /build/web/build ./web/buildRUN go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o one-apiFROM alpineRUN apk update \&& apk upgrade \&& apk add --no-cache ca-certificates tzdata \&& update-ca-certificates 2>/dev/null || trueCOPY --from=builder2 /build/one-api /EXPOSE 3000WORKDIR /dataRUN chmod 777 -R /dataENTRYPOINT ["/one-api"]123456789101112131415FROM ghcr.io/martialbe/one-api as builderFROM --platform=$BUILDPLATFORM caddy:2.6.2-alpine AS runnerWORKDIR /appCOPY --from=builder /one-api /app/one-apiCOPY Caddyfile ./CaddyfileRUN chmod 777 -R /appEXPOSE 3001CMD ["sh", "-c", "caddy run --config /app/Caddyfile & /app/one-api"]
Dockerfile+8-31