File size: 744 Bytes
bae99f4 0412086 bae99f4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
FROM node:lts AS BUILD_IMAGE
WORKDIR /app
# 更新软件包源,安装git,然后删除不再需要的包和缓存
RUN apt-get update && \
apt-get install -y git && \
git clone https://github.com/LLM-Red-Team/spark-free-api.git /app && \
apt-get remove -y git && \
apt-get autoremove -y
RUN yarn install --registry https://registry.npmmirror.com/ && yarn run build
FROM node:lts-alpine
COPY --from=BUILD_IMAGE /app/configs /app/configs
COPY --from=BUILD_IMAGE /app/package.json /app/package.json
COPY --from=BUILD_IMAGE /app/dist /app/dist
COPY --from=BUILD_IMAGE /app/public /app/public
COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules
WORKDIR /app
RUN chmod -R 777 /app
EXPOSE 8000
CMD ["npm", "start"] |