mirror of
https://github.com/LLM-Red-Team/kimi-free-api.git
synced 2024-12-23 01:49:19 +08:00
二阶段构建减少镜像体积
This commit is contained in:
parent
dc7a953e4f
commit
4993d043ab
11
Dockerfile
11
Dockerfile
@ -1,4 +1,4 @@
|
|||||||
FROM node:lts
|
FROM node:lts AS BUILD_IMAGE
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@ -6,6 +6,15 @@ COPY . /app
|
|||||||
|
|
||||||
RUN npm i --registry http://registry.npmmirror.com && npm run build
|
RUN npm i --registry http://registry.npmmirror.com && npm run build
|
||||||
|
|
||||||
|
FROM node:lts-alpine
|
||||||
|
|
||||||
|
COPY --from=BUILD_IMAGE /app/configs ./configs
|
||||||
|
COPY --from=BUILD_IMAGE /app/package.json ./package.json
|
||||||
|
COPY --from=BUILD_IMAGE /app/dist ./dist
|
||||||
|
COPY --from=BUILD_IMAGE /app/node_modules ./node_modules
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
CMD ["npm", "start"]
|
CMD ["npm", "start"]
|
Loading…
Reference in New Issue
Block a user