Skip to content

Commit

Permalink
fix: fix Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed Jan 7, 2024
1 parent aa3f605 commit 965d7fc
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
FROM node:16 as builder

WORKDIR /web
COPY ./VERSION .
COPY ./web .

WORKDIR /web/default
COPY web/default/package.json .
RUN npm install
COPY ./web/default .
COPY ./VERSION .
RUN mkdir -p ../build/default
RUN GENERATE_SOURCEMAP='false' DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
RUN ls
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build

WORKDIR /web/berry
COPY web/berry/package.json .
RUN npm install
COPY ./web/berry .
COPY ./VERSION .
RUN mkdir -p ../build/berry
RUN GENERATE_SOURCEMAP='false' DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build

WORKDIR /web/build
WORKDIR /web
RUN ls
RUN ls ./build
RUN ls ./build/default

FROM golang AS builder2

Expand All @@ -30,10 +27,7 @@ WORKDIR /build
ADD go.mod go.sum ./
RUN go mod download
COPY . .
COPY --from=builder /web/build ./web
RUN ls ./web
RUN ls ./web/build
RUN ls ./web/build/default
COPY --from=builder /web/build ./web/build
RUN go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o one-api

FROM alpine
Expand Down

0 comments on commit 965d7fc

Please sign in to comment.