From a9de3eb8533af9fcfb93be59eaab9323201e744a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=A8=8133321?= <33321@sangfor.com> Date: Tue, 8 Sep 2026 17:00:51 +0800 Subject: [PATCH] 0908 --- office-site/.dockerignore | 7 +++++++ office-site/Dockerfile | 13 +++++++++++++ office-site/docker-compose.yml | 15 +++++++++++++++ office-site/nginx.conf | 23 +++++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 office-site/.dockerignore create mode 100644 office-site/Dockerfile create mode 100644 office-site/docker-compose.yml create mode 100644 office-site/nginx.conf diff --git a/office-site/.dockerignore b/office-site/.dockerignore new file mode 100644 index 0000000..9e5f8d6 --- /dev/null +++ b/office-site/.dockerignore @@ -0,0 +1,7 @@ +.git +.gitignore +建设说明.md +*.md +Dockerfile +docker-compose.yml +.dockerignore diff --git a/office-site/Dockerfile b/office-site/Dockerfile new file mode 100644 index 0000000..d69ad18 --- /dev/null +++ b/office-site/Dockerfile @@ -0,0 +1,13 @@ +# 泽枢云启 官方网站 —— 静态站点镜像 +FROM nginx:1.27-alpine + +# 站点静态文件 +COPY index.html guide.html report.html support.html /usr/share/nginx/html/ +COPY assets/ /usr/share/nginx/html/assets/ + +# 自定义 nginx 配置(支持无后缀访问 /guide、/report、/support) +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/office-site/docker-compose.yml b/office-site/docker-compose.yml new file mode 100644 index 0000000..4db269e --- /dev/null +++ b/office-site/docker-compose.yml @@ -0,0 +1,15 @@ +services: + web: + build: . + image: zeshu-office-site:latest + container_name: zeshu-office-site + ports: + - "8080:80" # 宿主机 8080 → 容器 80,可改为 "80:80" + restart: unless-stopped + # 如需挂载本地文件实时预览(开发用),取消下面两行注释 + # volumes: + # - ./index.html:/usr/share/nginx/html/index.html:ro + # - ./guide.html:/usr/share/nginx/html/guide.html:ro + # - ./report.html:/usr/share/nginx/html/report.html:ro + # - ./support.html:/usr/share/nginx/html/support.html:ro + # - ./assets:/usr/share/nginx/html/assets:ro diff --git a/office-site/nginx.conf b/office-site/nginx.conf new file mode 100644 index 0000000..f5d8eb5 --- /dev/null +++ b/office-site/nginx.conf @@ -0,0 +1,23 @@ +server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + # 开启压缩 + gzip on; + gzip_min_length 1k; + gzip_types text/plain text/css application/javascript application/json image/svg+xml; + + # 静态资源缓存 + location ~* \.(css|js|svg|png|jpg|jpeg|gif|ico|woff2?)$ { + expires 7d; + add_header Cache-Control "public"; + } + + # 支持 /guide、/report、/support 无后缀访问 + location / { + try_files $uri $uri.html $uri/ /index.html; + } +}