From eed15cd23c5966b0ae2852d29f30f1a436e4f294 Mon Sep 17 00:00:00 2001 From: sudoooooo Date: Mon, 20 May 2024 20:18:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20nginx=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 5 ++--- docker-compose.yaml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 649ab2aa..f4214aab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,13 +8,12 @@ WORKDIR /xiaoju-survey COPY . /xiaoju-survey # 安装nginx -RUN apt-get update && \ - apt-get install -y nginx +RUN apt-get update && apt-get install -y nginx RUN npm config set registry https://registry.npmjs.org/ # 安装项目依赖 -RUN cd /xiaoju-survey/web && npm install && npm run build +RUN cd /xiaoju-survey/web && npm install && npm run build-only # 覆盖nginx配置文件 COPY ./nginx/nginx.conf /etc/nginx/nginx.conf diff --git a/docker-compose.yaml b/docker-compose.yaml index 24a7b144..261fd8d0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,11 +15,11 @@ services: - xiaoju-survey xiaoju-survey: - image: "xiaojusurvey/xiaoju-survey:1.1.0-slim" + image: "xiaojusurvey/xiaoju-survey:1.1.2-slim" container_name: xiaoju-survey restart: always ports: - - "8080:8080" # API端口 + - "8080:80" # API端口 environment: XIAOJU_SURVEY_MONGO_URL: mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@xiaoju-survey-mongo:27017 # docker-compose 会根据容器名称自动处理 links: