feat(deploy): 完整 Docker 部署方案 — 寄卖商城 + 积分商城
新增两步独立 Docker 部署方案(czleilei240 环境): 步骤一 寄卖商城(integral-resell) - step1-integral/docker-compose.yml:redis(Alpine自建) + houtai(webman PHP8) + h5(Nginx) - houtai.Dockerfile:PHP 8.0 + 阿里云镜像源 + webman.bin entrypoint - h5.Dockerfile:Nginx + configs.js 环境变量动态重写 - redis.Dockerfile:Alpine + apk 构建,绕过 DockerHub 镜像源问题 - 宿主机 bind-mount:/www/wwwroot/leileiadmin.czchunfang.com(FTP可直接更新程序) 步骤二 积分商城(single-shop-22) - step2-single-shop/docker-compose.yml:redis + admin-api + front-api + admin-web + h5 - Java Dockerfiles:OpenJDK 17 + --add-opens Spring Boot 2.2.6 兼容 公共配置 - nginx/:四个域名宝塔 Nginx 反代配置(HTTP→HTTPS 301、SSL 终止) - scripts/:sync-to-server.sh / deploy-step1.sh / remote-up.sh - DOCKER_DEPLOY.md:完整部署文档 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
82
deploy/docker/nginx/leileiadmin.czchunfang.com.conf
Normal file
82
deploy/docker/nginx/leileiadmin.czchunfang.com.conf
Normal file
@@ -0,0 +1,82 @@
|
||||
upstream resell_api {
|
||||
server 127.0.0.1:18085;
|
||||
keepalive 10240;
|
||||
}
|
||||
|
||||
server
|
||||
{
|
||||
listen 80;
|
||||
listen 443 ssl http2;
|
||||
server_name leileiadmin.czchunfang.com;
|
||||
index index.html index.htm default.htm default.html;
|
||||
root /www/wwwroot/leileiadmin.czchunfang.com;
|
||||
include /www/server/panel/vhost/nginx/extension/leileiadmin.czchunfang.com/*.conf;
|
||||
#CERT-APPLY-CHECK--START
|
||||
include /www/server/panel/vhost/nginx/well-known/leileiadmin.czchunfang.com.conf;
|
||||
#CERT-APPLY-CHECK--END
|
||||
|
||||
#SSL-START
|
||||
#error_page 404/404.html;
|
||||
#HTTP_TO_HTTPS_START
|
||||
set $isRedcert 1;
|
||||
if ($server_port != 443) {
|
||||
set $isRedcert 2;
|
||||
}
|
||||
if ( $uri ~ /\.well-known/ ) {
|
||||
set $isRedcert 1;
|
||||
}
|
||||
if ($isRedcert != 1) {
|
||||
rewrite ^(/.*)$ https://$host$1 permanent;
|
||||
}
|
||||
#HTTP_TO_HTTPS_END
|
||||
ssl_certificate /www/wwwroot/integral-shop/deploy/docker/ssl-cert/leileiadmin.czchunfang.com_cert/nginx/leileiadmin.czchunfang.com.pem;
|
||||
ssl_certificate_key /www/wwwroot/integral-shop/deploy/docker/ssl-cert/leileiadmin.czchunfang.com_cert/nginx/leileiadmin.czchunfang.com.key;
|
||||
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_tickets on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 10m;
|
||||
add_header Strict-Transport-Security "max-age=31536000";
|
||||
error_page 497 https://$host$request_uri;
|
||||
#SSL-END
|
||||
|
||||
#REWRITE-START
|
||||
include /www/server/panel/vhost/rewrite/html_leileiadmin.czchunfang.com.conf;
|
||||
#REWRITE-END
|
||||
|
||||
# 寄卖商城后台 API → Docker integral-houtai 容器(webman.bin 写死端口 8785)
|
||||
location ^~ / {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
if (!-f $request_filename) {
|
||||
proxy_pass http://resell_api;
|
||||
}
|
||||
}
|
||||
|
||||
location ~* (\.user.ini|\.htaccess|\.htpasswd|\.env.*|\.project|\.bashrc|\.bash_profile|\.bash_logout|\.DS_Store|\.gitignore|\.gitattributes|LICENSE|README\.md|CLAUDE\.md|CHANGELOG\.md|CHANGELOG|CONTRIBUTING\.md|TODO\.md|FAQ\.md|composer\.json|composer\.lock|package(-lock)?\.json|yarn\.lock|pnpm-lock\.yaml|\.\w+~|\.swp|\.swo|\.bak(up)?|\.old|\.tmp|\.temp|\.log|\.sql(\.gz)?|docker-compose\.yml|docker\.env|Dockerfile|\.csproj|\.sln|Cargo\.toml|Cargo\.lock|go\.mod|go\.sum|phpunit\.xml|phpunit\.xml|pom\.xml|build\.gradl|pyproject\.toml|requirements\.txt|application(-\w+)?\.(ya?ml|properties))$
|
||||
{ return 404; }
|
||||
|
||||
location ~* /(\.git|\.svn|\.bzr|\.vscode|\.claude|\.idea|\.ssh|\.github|\.npm|\.yarn|\.pnpm|\.cache|\.husky|\.turbo|\.next|\.nuxt|node_modules|runtime)/
|
||||
{ return 404; }
|
||||
|
||||
location ~ \.well-known { allow all; }
|
||||
|
||||
if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
|
||||
return 403;
|
||||
}
|
||||
|
||||
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
|
||||
expires 30d; error_log /dev/null; access_log /dev/null;
|
||||
}
|
||||
location ~ .*\.(js|css)?$ {
|
||||
expires 12h; error_log /dev/null; access_log /dev/null;
|
||||
}
|
||||
|
||||
access_log /www/wwwlogs/leileiadmin.czchunfang.com.log;
|
||||
error_log /www/wwwlogs/leileiadmin.czchunfang.com.error.log;
|
||||
}
|
||||
Reference in New Issue
Block a user