chore: add sqszx202 deployment config
This commit is contained in:
54
deploy/docker/single-shop/admin-api.Dockerfile
Normal file
54
deploy/docker/single-shop/admin-api.Dockerfile
Normal file
@@ -0,0 +1,54 @@
|
||||
# =============================================================
|
||||
# 积分商城 管理端 API(miao-admin-2.2.jar)
|
||||
# JAR 由宿主机 bind-mount 进来(/app/app.jar),无需 Maven 编译
|
||||
# 宿主机路径:${SINGLE_ADMIN_JAR} → /app/app.jar
|
||||
# FTP 更新 JAR 后:docker compose --env-file .env restart single-admin-api
|
||||
# =============================================================
|
||||
|
||||
FROM eclipse-temurin:17-jre-jammy
|
||||
|
||||
ENV TZ=Asia/Shanghai \
|
||||
LANG=C.UTF-8 LC_ALL=C.UTF-8 \
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# 切换阿里云 Ubuntu 镜像源(服务器访问 archive.ubuntu.com 超时)
|
||||
RUN sed -i \
|
||||
-e 's|http://archive.ubuntu.com|https://mirrors.aliyun.com|g' \
|
||||
-e 's|http://security.ubuntu.com|https://mirrors.aliyun.com|g' \
|
||||
/etc/apt/sources.list
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
tzdata ca-certificates curl \
|
||||
fontconfig fonts-dejavu fonts-wqy-zenhei \
|
||||
&& ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \
|
||||
&& echo $TZ > /etc/timezone \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir -p /app /config /usr/local/crmeb/crmebimage /app/log
|
||||
|
||||
# 堆大小(可通过 compose environment 覆盖)
|
||||
ENV JAVA_HEAP_OPTS="-Xms128m -Xmx256m"
|
||||
|
||||
# Spring Boot 2.2.6 + Java 17 必须的模块开放参数
|
||||
ENV JAVA_MODULE_OPTS="\
|
||||
--add-opens java.base/java.lang=ALL-UNNAMED \
|
||||
--add-opens java.base/java.lang.reflect=ALL-UNNAMED \
|
||||
--add-opens java.base/java.util=ALL-UNNAMED \
|
||||
--add-opens java.base/java.io=ALL-UNNAMED \
|
||||
--add-opens java.base/java.math=ALL-UNNAMED \
|
||||
--add-opens java.base/sun.net.util=ALL-UNNAMED \
|
||||
--add-opens java.base/java.net=ALL-UNNAMED"
|
||||
|
||||
WORKDIR /app
|
||||
# /app/app.jar 由 docker-compose volumes bind-mount 进来
|
||||
EXPOSE 30032
|
||||
|
||||
# 等价于:nohup java -Xms128m -Xmx256m -jar miao-admin-2.2.jar > admin.log &
|
||||
ENTRYPOINT ["sh","-c","exec java \
|
||||
$JAVA_HEAP_OPTS \
|
||||
$JAVA_MODULE_OPTS \
|
||||
-Dfile.encoding=UTF-8 \
|
||||
-Duser.timezone=$TZ \
|
||||
-jar /app/app.jar \
|
||||
--spring.profiles.active=${SPRING_PROFILES_ACTIVE:-docker} \
|
||||
--spring.config.additional-location=file:/config/ \
|
||||
--server.port=${SERVER_PORT:-30032}"]
|
||||
61
deploy/docker/single-shop/admin-web.Dockerfile
Normal file
61
deploy/docker/single-shop/admin-web.Dockerfile
Normal file
@@ -0,0 +1,61 @@
|
||||
# =============================================================
|
||||
# 积分商城 管理后台前端(Vue 2 SPA)
|
||||
# 纯 Nginx 运行时镜像,不含 Node 构建阶段
|
||||
# 静态文件由宿主机 bind-mount 进来(${SINGLE_ADMIN_WEB_DIR}:/usr/share/nginx/html)
|
||||
# 宿主机目录示例:/www/wwwroot/jfadmin.j3s4s5.com/
|
||||
# 更新方式:rsync 新 dist 到宿主机目录 → 无需重建镜像
|
||||
# =============================================================
|
||||
|
||||
FROM nginx:1.25-alpine
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
# 切换阿里云 Alpine 镜像源
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
||||
&& apk add --no-cache tzdata \
|
||||
&& cp /usr/share/zoneinfo/$TZ /etc/localtime \
|
||||
&& echo $TZ > /etc/timezone \
|
||||
&& rm -f /etc/apk/cache/*.apk
|
||||
|
||||
# Nginx 反代配置
|
||||
# /api/ 和 /adminapi/ 代理到 single-admin-api 容器
|
||||
RUN cat > /etc/nginx/conf.d/default.conf <<'NGX'
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
client_max_body_size 50m;
|
||||
add_header X-Frame-Options SAMEORIGIN always;
|
||||
|
||||
location ~* \.(?:js|css|png|jpg|jpeg|gif|svg|woff2?|ttf|map)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000, immutable";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://single-admin-api:30032/api/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 120s;
|
||||
client_max_body_size 50m;
|
||||
}
|
||||
|
||||
location /adminapi/ {
|
||||
proxy_pass http://single-admin-api:30032/adminapi/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
NGX
|
||||
|
||||
EXPOSE 80
|
||||
71
deploy/docker/single-shop/application-docker.yml
Normal file
71
deploy/docker/single-shop/application-docker.yml
Normal file
@@ -0,0 +1,71 @@
|
||||
# =============================================================
|
||||
# 积分商城 Docker 部署专用 Spring profile
|
||||
# 通过 --spring.config.additional-location=file:/config/ + --spring.profiles.active=docker
|
||||
# 加载本文件,并由环境变量覆盖关键参数
|
||||
# =============================================================
|
||||
|
||||
server:
|
||||
port: ${SERVER_PORT:-30032}
|
||||
|
||||
crmeb:
|
||||
imagePath: /usr/local/crmeb/
|
||||
domain: https://j3s4s5.com
|
||||
captchaOn: false
|
||||
asyncConfig: true
|
||||
demoSite: false
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
name: ${MYSQL_DATABASE}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT:3306}/${MYSQL_DATABASE}?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: ${MYSQL_USERNAME}
|
||||
password: ${MYSQL_PASSWORD}
|
||||
druid:
|
||||
initial-size: 5
|
||||
min-idle: 5
|
||||
max-active: 50
|
||||
max-wait: 60000
|
||||
validation-query: SELECT 1
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
redis:
|
||||
host: ${REDIS_HOST:redis}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PASSWORD:}
|
||||
database: ${REDIS_DATABASE:0}
|
||||
timeout: 10000
|
||||
jedis:
|
||||
pool:
|
||||
max-active: 200
|
||||
max-wait: -1
|
||||
max-idle: 10
|
||||
min-idle: 0
|
||||
time-between-eviction-runs: -1
|
||||
second:
|
||||
database: ${REDIS_SECOND_DATABASE:1}
|
||||
|
||||
# 订单同步(无 MER 时填默认)
|
||||
sync:
|
||||
source-id: ${SYNC_SOURCE_ID:}
|
||||
target-mer-id: ${SYNC_TARGET_MER_ID:0}
|
||||
|
||||
logging:
|
||||
level:
|
||||
io.swagger.*: error
|
||||
com.zbjk.crmeb: info
|
||||
org.springframework.boot.autoconfigure: ERROR
|
||||
config: classpath:logback-spring.xml
|
||||
file:
|
||||
path: /app/log
|
||||
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl:
|
||||
|
||||
swagger:
|
||||
basic:
|
||||
enable: false
|
||||
check: false
|
||||
54
deploy/docker/single-shop/front-api.Dockerfile
Normal file
54
deploy/docker/single-shop/front-api.Dockerfile
Normal file
@@ -0,0 +1,54 @@
|
||||
# =============================================================
|
||||
# 积分商城 用户端 API(miao-front-2.2.jar)
|
||||
# JAR 由宿主机 bind-mount 进来(/app/app.jar),无需 Maven 编译
|
||||
# 宿主机路径:${SINGLE_FRONT_JAR} → /app/app.jar
|
||||
# FTP 更新 JAR 后:docker compose --env-file .env restart single-front-api
|
||||
# =============================================================
|
||||
|
||||
FROM eclipse-temurin:17-jre-jammy
|
||||
|
||||
ENV TZ=Asia/Shanghai \
|
||||
LANG=C.UTF-8 LC_ALL=C.UTF-8 \
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# 切换阿里云 Ubuntu 镜像源(服务器访问 archive.ubuntu.com 超时)
|
||||
RUN sed -i \
|
||||
-e 's|http://archive.ubuntu.com|https://mirrors.aliyun.com|g' \
|
||||
-e 's|http://security.ubuntu.com|https://mirrors.aliyun.com|g' \
|
||||
/etc/apt/sources.list
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
tzdata ca-certificates curl \
|
||||
fontconfig fonts-dejavu fonts-wqy-zenhei \
|
||||
&& ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \
|
||||
&& echo $TZ > /etc/timezone \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir -p /app /config /usr/local/crmeb/crmebimage /app/log
|
||||
|
||||
# 堆大小(可通过 compose environment 覆盖)
|
||||
ENV JAVA_HEAP_OPTS="-Xms128m -Xmx256m"
|
||||
|
||||
# Spring Boot 2.2.6 + Java 17 必须的模块开放参数
|
||||
ENV JAVA_MODULE_OPTS="\
|
||||
--add-opens java.base/java.lang=ALL-UNNAMED \
|
||||
--add-opens java.base/java.lang.reflect=ALL-UNNAMED \
|
||||
--add-opens java.base/java.util=ALL-UNNAMED \
|
||||
--add-opens java.base/java.io=ALL-UNNAMED \
|
||||
--add-opens java.base/java.math=ALL-UNNAMED \
|
||||
--add-opens java.base/sun.net.util=ALL-UNNAMED \
|
||||
--add-opens java.base/java.net=ALL-UNNAMED"
|
||||
|
||||
WORKDIR /app
|
||||
# /app/app.jar 由 docker-compose volumes bind-mount 进来
|
||||
EXPOSE 30033
|
||||
|
||||
# 等价于:nohup java -Xms128m -Xmx256m -jar miao-front-2.2.jar > front.log &
|
||||
ENTRYPOINT ["sh","-c","exec java \
|
||||
$JAVA_HEAP_OPTS \
|
||||
$JAVA_MODULE_OPTS \
|
||||
-Dfile.encoding=UTF-8 \
|
||||
-Duser.timezone=$TZ \
|
||||
-jar /app/app.jar \
|
||||
--spring.profiles.active=${SPRING_PROFILES_ACTIVE:-docker} \
|
||||
--spring.config.additional-location=file:/config/ \
|
||||
--server.port=${SERVER_PORT:-30033}"]
|
||||
55
deploy/docker/single-shop/h5.Dockerfile
Normal file
55
deploy/docker/single-shop/h5.Dockerfile
Normal file
@@ -0,0 +1,55 @@
|
||||
# =============================================================
|
||||
# 积分商城 用户端 H5(uni-app SPA)
|
||||
# 纯 Nginx 运行时镜像,不含 Node 构建阶段
|
||||
# 静态文件由宿主机 bind-mount 进来(${SINGLE_H5_DIR}:/usr/share/nginx/html)
|
||||
# 宿主机目录示例:/www/wwwroot/jf.j3s4s5.com/
|
||||
# 更新方式:rsync 新 dist 到宿主机目录 → 无需重建镜像
|
||||
# =============================================================
|
||||
|
||||
FROM nginx:1.25-alpine
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
# 切换阿里云 Alpine 镜像源
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
||||
&& apk add --no-cache tzdata \
|
||||
&& cp /usr/share/zoneinfo/$TZ /etc/localtime \
|
||||
&& echo $TZ > /etc/timezone \
|
||||
&& rm -f /etc/apk/cache/*.apk
|
||||
|
||||
# Nginx 反代配置
|
||||
# API 请求代理到 single-front-api 容器(Docker 内网,不经宝塔 Nginx)
|
||||
RUN cat > /etc/nginx/conf.d/default.conf <<'NGX'
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
client_max_body_size 50m;
|
||||
add_header X-Frame-Options SAMEORIGIN always;
|
||||
|
||||
location ~* \.(?:js|css|png|jpg|jpeg|gif|svg|woff2?|ttf|map)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000, immutable";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# 前台 API(单点登录/商品/订单等)
|
||||
location /api/ {
|
||||
proxy_pass http://single-front-api:30033/api/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 120s;
|
||||
client_max_body_size 50m;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
NGX
|
||||
|
||||
EXPOSE 80
|
||||
37
deploy/docker/single-shop/nginx-admin-web.conf
Normal file
37
deploy/docker/single-shop/nginx-admin-web.conf
Normal file
@@ -0,0 +1,37 @@
|
||||
# 仅供参考: 内容已内联到 admin-web.Dockerfile
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
client_max_body_size 50m;
|
||||
add_header X-Frame-Options SAMEORIGIN always;
|
||||
|
||||
location ~* \.(?:js|css|png|jpg|jpeg|gif|svg|woff2?|ttf|map)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000, immutable";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://single-admin-api:30032/api/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 120s;
|
||||
client_max_body_size 50m;
|
||||
}
|
||||
|
||||
location /adminapi/ {
|
||||
proxy_pass http://single-admin-api:30032/adminapi/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
30
deploy/docker/single-shop/nginx-h5.conf
Normal file
30
deploy/docker/single-shop/nginx-h5.conf
Normal file
@@ -0,0 +1,30 @@
|
||||
# 仅供参考: 内容已内联到 h5.Dockerfile
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
client_max_body_size 50m;
|
||||
add_header X-Frame-Options SAMEORIGIN always;
|
||||
|
||||
location ~* \.(?:js|css|png|jpg|jpeg|gif|svg|woff2?|ttf|map)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000, immutable";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://single-front-api:30033/api/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 120s;
|
||||
client_max_body_size 50m;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user