refactor: docker ci
This commit is contained in:
parent
03804b8364
commit
a153137604
|
@ -1,4 +1,4 @@
|
|||
FROM node:18 AS build
|
||||
FROM node:16.19 AS build
|
||||
|
||||
# 创建一个项目文件夹,可自定义
|
||||
WORKDIR /app
|
||||
|
@ -6,14 +6,15 @@ WORKDIR /app
|
|||
COPY ./apps/server/ .
|
||||
|
||||
RUN ls -a
|
||||
RUN npm set registry https://registry.npm.taobao.org
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
RUN npm set registry https://registry.npm.taobao.org
|
||||
RUN npm install -g pnpm
|
||||
RUN pnpm i
|
||||
RUN pnpm build
|
||||
|
||||
|
||||
|
||||
# 切换镜像文件, alpine镜像打包后更小
|
||||
FROM node:18-alpine
|
||||
FROM node:16.19-alpine
|
||||
# 切换工作目录
|
||||
WORKDIR /app
|
||||
# 将打包后的的文件复制到docker镜像里
|
||||
|
@ -31,7 +32,6 @@ COPY --from=build /app/.env ./
|
|||
ENV TZ="Asia/Shanghai"
|
||||
|
||||
RUN npm set registry https://registry.npm.taobao.org
|
||||
|
||||
# 安装工程依赖
|
||||
RUN npm install --production
|
||||
# 设置暴露端口
|
||||
|
|
Loading…
Reference in New Issue
Block a user