Compare commits

..

No commits in common. "1990a9e9706318925dbf8350ba9726ef24fdd8f3" and "f70beb3179deead232058cabd8d3fc9986449065" have entirely different histories.

2 changed files with 4 additions and 7 deletions

View File

@ -179,8 +179,6 @@ steps:
- name: docker_sock
path: /var/run/docker.sock
commands:
- cp /localcache/${DRONE_REPO_NAME}/dist-${DRONE_TAG}.tgz dist.tgz
- ls -lh dist.tgz
- docker info
- docker build -t ${DRONE_REPO_NAME}-frontend:latest -f docker/Dockerfile-frontend .
- docker tag ${DRONE_REPO_NAME}-frontend:latest ${DRONE_REPO_NAME}-frontend:${DRONE_COMMIT_SHA:0:8}

View File

@ -7,12 +7,12 @@ WORKDIR /app
COPY vue-ui/package*.json ./
# 使用国内镜像源并安装依赖
# RUN npm config set registry https://registry.npmmirror.com \
# && npm ci --no-audit --no-fund
RUN npm config set registry https://registry.npmmirror.com \
&& npm ci --no-audit --no-fund
# 复制源码并构建
COPY vue-ui/ .
# RUN npm run build
RUN npm run build
# 运行阶段,使用独立 nginx 镜像
FROM registry.cn-beijing.aliyuncs.com/yinzy/nginx:latest AS runtime
@ -22,8 +22,7 @@ WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
# 拷贝构建产物
# 直接使用构建上下文中的 dist.tgz
ADD dist.tgz .
COPY --from=builder /app/dist .
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]