diff --git a/Dockerfile b/Dockerfile index db3dba1a..e61b04cf 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 79cee71d..261fd8d0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,11 +15,11 @@ services: - xiaoju-survey xiaoju-survey: - image: "xiaojusurvey/xiaoju-survey:1.0.4" + 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: