FROM node:20 AS build # 添加 git,以便之后能从GitHub克隆项目 RUN apt install git # 从 GitHub 克隆项目到 /app 目录下 RUN git clone https://github.com/Dooy/chatgpt-web-midjourney-proxy.git /app COPY ./logo.png /app/web/src/assets/logo.png COPY ./logo.png /app/web/src/public/favicon.ico COPY ./home.vue /app/web/src/pages/home.vue COPY ./package.json /app/package.json #COPY . /app # RUN yarn config set registry https://mirrors.cloud.tencent.com/npm/ WORKDIR /app RUN yarn install && yarn run build WORKDIR /app/web RUN yarn install && yarn run build # 添加调试命令 #RUN ls -R /app FROM node:20-alpine WORKDIR /app # Install dotenvx #RUN curl -fsS https://dotenvx.sh/ | sh #COPY .env /app COPY --from=build /app/dist ./dist #COPY --from=build /app/backend ./backend #COPY --from=build /app/web/build ./web/build COPY --from=build /app/package.json ./ # RUN yarn config set registry https://mirrors.cloud.tencent.com/npm/ RUN yarn install --production && yarn cache clean EXPOSE 3000 CMD yarn run start