From 850a6af1e0820d38b8095f5c1225b5e14d2afa43 Mon Sep 17 00:00:00 2001 From: Svend Date: Tue, 15 Oct 2024 21:45:05 +0800 Subject: [PATCH] fix: fix the issues with the local build docker script (#4647) --- package.json | 2 +- scripts/deploy/Dockerfile | 4 ++-- scripts/deploy/build-local-docker-image.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 4c4cfee2db2..61189865619 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo build", "build:analyze": "turbo build:analyze", "build:antd": "pnpm run build --filter=@vben/web-antd", - "build:docker": "./build-local-docker-image.sh", + "build:docker": "./scripts/deploy/build-local-docker-image.sh", "build:docs": "pnpm run build --filter=@vben/docs", "build:ele": "pnpm run build --filter=@vben/web-ele", "build:naive": "pnpm run build --filter=@vben/web-naive", diff --git a/scripts/deploy/Dockerfile b/scripts/deploy/Dockerfile index 61076b6dc38..39d2ce708c0 100644 --- a/scripts/deploy/Dockerfile +++ b/scripts/deploy/Dockerfile @@ -18,12 +18,12 @@ RUN pnpm run build RUN echo "Builder Success 🎉" -FROM nginx:stable-alpine as production +FROM nginx:stable-alpine AS production RUN echo "types { application/javascript js mjs; }" > /etc/nginx/conf.d/mjs.conf COPY --from=builder /app/playground/dist /usr/share/nginx/html -COPY ./nginx.conf /etc/nginx/nginx.conf +COPY --from=builder /app/scripts/deploy/nginx.conf /etc/nginx/nginx.conf EXPOSE 8080 diff --git a/scripts/deploy/build-local-docker-image.sh b/scripts/deploy/build-local-docker-image.sh index d33bd7c6434..4881487f45c 100755 --- a/scripts/deploy/build-local-docker-image.sh +++ b/scripts/deploy/build-local-docker-image.sh @@ -24,7 +24,7 @@ function install_dependencies() { function build_image() { # build docker - docker build . -f Dockerfile -t ${IMAGE_NAME} || ERROR="build_image failed" + docker build ../../ -f Dockerfile -t ${IMAGE_NAME} || ERROR="build_image failed" } function log_message() {