From 0598597e3e21150ad5a04a2e8af4b91940d0c352 Mon Sep 17 00:00:00 2001 From: bunny <1319900154@qq.com> Date: Sat, 24 May 2025 15:49:55 +0800 Subject: [PATCH] =?UTF-8?q?:green=5Fheart:=20=F0=9F=93=A6=20=E6=89=93?= =?UTF-8?q?=E5=8C=85=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 5 ++--- docker/Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5ddbc66..4c8a55c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,7 @@ build-job: # 打印编译开始信息 - echo "Compiling the code..." # 使用Maven编译Java项目,跳过测试 - - npm i -g pnpm && pnpm i + - npm i -g pnpm && pnpm i && pnpm build # 打印编译完成信息 - echo "Compile complete." # 从Docker Hub拉取OpenJDK基础镜像 @@ -29,8 +29,7 @@ build-job: # 打印拉取完成信息 - echo "docker pull complete." # 使用Dockerfile构建Docker镜像,并打上标签 - - ls - - pnpm build && cd docker && docker build -f Dockerfile -t $CONTAINER_NAME:$DOCKER_TAG . + - cd docker && pwd && ls && docker build -f Dockerfile -t $CONTAINER_NAME:$DOCKER_TAG . # 打印构建成功信息 - echo "Application successfully deployed." diff --git a/docker/Dockerfile b/docker/Dockerfile index 8a1123f..8686e0a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -19,9 +19,9 @@ RUN echo "Asia/Shanghai" > /etc/timezone WORKDIR /usr/share/nginx/html # 将前端项目打包文件复制到 Nginx 的默认静态文件目录 -COPY docker/dist/ /usr/share/nginx/html +COPY dist/ /usr/share/nginx/html # 复制到nginx目录下 -COPY docker/dist/ /etc/nginx/html +COPY dist/ /etc/nginx/html # 暴露 Nginx 的默认端口 EXPOSE 80