Merge branch 'main' into 'stg'

更改docker

See merge request cloud-mediate/mediate-manage-web!1
This commit is contained in:
刘翕 2025-01-22 02:10:28 +00:00
commit ea1681018b
2 changed files with 28 additions and 28 deletions

View File

@ -1,26 +1,26 @@
# syntax=docker/dockerfile:experimental # syntax=docker/dockerfile:experimental
FROM node:14.16.1 as build # FROM node:14.16.1 as build
WORKDIR /workspace # WORKDIR /workspace
COPY package.json . # COPY package.json .
RUN npm config set registry https://registry.npm.taobao.org # RUN npm config set registry https://registry.npm.taobao.org
RUN npm install # RUN npm install
# 打包需要编译或配置的文件 # # 打包需要编译或配置的文件
COPY src src # COPY src src
COPY public public # COPY public public
COPY babel.config.js babel.config.js # COPY babel.config.js babel.config.js
COPY vue.config.js vue.config.js # COPY vue.config.js vue.config.js
# 打包命令 # # 打包命令
RUN npm run build # RUN npm run build
FROM nginx:1.21.0 FROM nginx:1.21.0
RUN rm /etc/nginx/conf.d/default.conf RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx_prd.conf /etc/nginx/conf.d COPY nginx/nginx.conf /etc/nginx/conf.d
# 打包后的产物部署 # 打包后的产物部署
COPY --from=build workspace/dist /usr/share/nginx/html COPY dist /usr/share/nginx/html
EXPOSE 8065 EXPOSE 8065
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]

View File

@ -1,26 +1,26 @@
# syntax=docker/dockerfile:experimental # syntax=docker/dockerfile:experimental
FROM node:14.16.1 as build # FROM node:14.16.1 as build
WORKDIR /workspace # WORKDIR /workspace
COPY package.json . # COPY package.json .
RUN npm config set registry https://registry.npm.taobao.org # RUN npm config set registry https://registry.npm.taobao.org
RUN npm install # RUN npm install
# 打包需要编译或配置的文件 # # 打包需要编译或配置的文件
COPY src src # COPY src src
COPY public public # COPY public public
COPY babel.config.js babel.config.js # COPY babel.config.js babel.config.js
COPY vue.config.js vue.config.js # COPY vue.config.js vue.config.js
# 打包命令 # # 打包命令
RUN npm run build # RUN npm run build
FROM nginx:1.21.0 FROM nginx:1.21.0
RUN rm /etc/nginx/conf.d/default.conf RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx_stg.conf /etc/nginx/conf.d COPY nginx/nginx.conf /etc/nginx/conf.d
# 打包后的产物部署 # 打包后的产物部署
COPY --from=build workspace/dist /usr/share/nginx/html COPY dist /usr/share/nginx/html
EXPOSE 8065 EXPOSE 8065
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]