前端打包

This commit is contained in:
2025-11-24 16:53:17 +08:00
parent df57d05817
commit b51faf731a
10 changed files with 218 additions and 385 deletions

View File

@@ -13,7 +13,7 @@ services:
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-123456}
TZ: Asia/Shanghai
ports:
- "${MYSQL_PORT:-3306}:3306"
- "${MYSQL_PORT:-3307}:3306"
volumes:
# 数据持久化(命名卷)
- mysql-data:/var/lib/mysql
@@ -26,14 +26,16 @@ services:
- --default-authentication-plugin=mysql_native_password
- --max_connections=1000
- --max_allowed_packet=64M
- --local-infile=1
networks:
- school-news-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-p${MYSQL_ROOT_PASSWORD:-123456}"]
# 只有当 MySQL 可访问且敏感词表中至少有一条 deny 记录时,才认为 healthy
test: ["CMD-SHELL", "mysql -uroot -p${MYSQL_ROOT_PASSWORD:-123456} -D ${MYSQL_DATABASE:-school_news} -e \"SELECT 'ok' FROM tb_sensitive_word WHERE type='deny' LIMIT 1;\" 2>/dev/null | grep -q ok"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
timeout: 10s
retries: 10
start_period: 60s
# Redis缓存
redis:
@@ -143,8 +145,10 @@ services:
ports:
- "${NGINX_PORT:-80}:80"
volumes:
# Nginx配置文件(命名卷)
- nginx-config:/etc/nginx:ro
# 仅挂载自定义 Nginx配置文件
- ./volumes/nginx/config/nginx.conf:/etc/nginx/nginx.conf
# 仅挂载站点配置目录conf.d保留镜像内的 mime.types 等其他文件
- nginx-conf-d:/etc/nginx/conf.d:ro
# 日志目录(命名卷)
- nginx-logs:/var/log/nginx
networks:
@@ -233,12 +237,19 @@ volumes:
device: ./volumes/web/logs
# ===== Nginx =====
nginx-config:
nginx-conf-file:
driver: local
driver_opts:
type: none
o: bind
device: ./volumes/nginx/config
device: ./volumes/nginx/config/nginx.conf
nginx-conf-d:
driver: local
driver_opts:
type: none
o: bind
device: ./volumes/nginx/config/conf.d
nginx-logs:
driver: local