完善docker打包

This commit is contained in:
COOL 2024-07-13 09:36:23 +08:00
parent 82e161ef38
commit 1ee1fd7090
2 changed files with 3 additions and 3 deletions

View File

@ -14,6 +14,5 @@ run/
.tsbuildinfo
.tsbuildinfo.*
.audit
typings/
public/uploads/
cache/

View File

@ -15,8 +15,9 @@ ENV TZ="Asia/Shanghai"
# 如果各公司有自己的私有源可以替换registry地址,如使用官方源注释下一行
RUN npm config set registry https://registry.npmmirror.com
# 安装开发期依赖
# 复制package.json
COPY package.json ./package.json
# 安装依赖
RUN npm install
# 构建项目
COPY . .
@ -24,7 +25,7 @@ RUN npm run build
# 删除开发期依赖
RUN rm -rf node_modules && rm package-lock.json
# 安装生产环境依赖
RUN npm install --production
RUN npm install
# 如果端口更换,这边可以更新一下
EXPOSE 8001