0908
This commit is contained in:
7
office-site/.dockerignore
Normal file
7
office-site/.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
建设说明.md
|
||||||
|
*.md
|
||||||
|
Dockerfile
|
||||||
|
docker-compose.yml
|
||||||
|
.dockerignore
|
||||||
13
office-site/Dockerfile
Normal file
13
office-site/Dockerfile
Normal file
@@ -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;"]
|
||||||
15
office-site/docker-compose.yml
Normal file
15
office-site/docker-compose.yml
Normal file
@@ -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
|
||||||
23
office-site/nginx.conf
Normal file
23
office-site/nginx.conf
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user