mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2024-11-01 14:10:29 +08:00
完善docker打包
This commit is contained in:
parent
82e161ef38
commit
1ee1fd7090
@ -14,6 +14,5 @@ run/
|
|||||||
.tsbuildinfo
|
.tsbuildinfo
|
||||||
.tsbuildinfo.*
|
.tsbuildinfo.*
|
||||||
.audit
|
.audit
|
||||||
typings/
|
|
||||||
public/uploads/
|
public/uploads/
|
||||||
cache/
|
cache/
|
||||||
|
@ -15,8 +15,9 @@ ENV TZ="Asia/Shanghai"
|
|||||||
# 如果各公司有自己的私有源,可以替换registry地址,如使用官方源注释下一行
|
# 如果各公司有自己的私有源,可以替换registry地址,如使用官方源注释下一行
|
||||||
RUN npm config set registry https://registry.npmmirror.com
|
RUN npm config set registry https://registry.npmmirror.com
|
||||||
|
|
||||||
# 安装开发期依赖
|
# 复制package.json
|
||||||
COPY package.json ./package.json
|
COPY package.json ./package.json
|
||||||
|
# 安装依赖
|
||||||
RUN npm install
|
RUN npm install
|
||||||
# 构建项目
|
# 构建项目
|
||||||
COPY . .
|
COPY . .
|
||||||
@ -24,7 +25,7 @@ RUN npm run build
|
|||||||
# 删除开发期依赖
|
# 删除开发期依赖
|
||||||
RUN rm -rf node_modules && rm package-lock.json
|
RUN rm -rf node_modules && rm package-lock.json
|
||||||
# 安装生产环境依赖
|
# 安装生产环境依赖
|
||||||
RUN npm install --production
|
RUN npm install
|
||||||
|
|
||||||
# 如果端口更换,这边可以更新一下
|
# 如果端口更换,这边可以更新一下
|
||||||
EXPOSE 8001
|
EXPOSE 8001
|
||||||
|
Loading…
Reference in New Issue
Block a user