build: 生产编排(独立compose/nginx配置/预构建产物)+图标生成脚本

This commit is contained in:
2026-09-12 23:41:17 +08:00
parent 2a111d21c0
commit 4f8dd8be75
3 changed files with 78 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location /admin/ {
try_files $uri $uri/ /admin/index.html;
}
location = /admin { return 301 /admin/; }
location = / { return 301 /admin/; }
location ~* \.(js|css|png|jpg|svg|woff2?)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
}
+13
View File
@@ -0,0 +1,13 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location ~* \.(js|css|png|jpg|svg|woff2?)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
}
+50
View File
@@ -0,0 +1,50 @@
# 生产独立编排:docker compose -f docker-compose.prod.yml up -d
services:
mongodb:
image: mongo:7
restart: unless-stopped
volumes:
- mongo_data:/data/db
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USER:-wdkj}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASS:?need MONGO_PASS}
dimension-server:
image: dim-server:v1.3.0
restart: unless-stopped
depends_on:
- mongodb
ports:
- "127.0.0.1:3001:3001"
environment:
- TZ=Asia/Shanghai
- NODE_ENV=production
- PORT=3001
- MONGODB_URI=mongodb://${MONGO_USER:-wdkj}:${MONGO_PASS}@mongodb:27017/wdkj?authSource=admin
- JWT_SECRET=${JWT_SECRET:?need JWT_SECRET}
- SITE_URL=https://wdkj.yuzhiran.com.cn
- INVITE_REWARD_CREDITS=${INVITE_REWARD_CREDITS:-100}
- COST_PER_WORK=${COST_PER_WORK:-10}
- FREE_DAILY_QUOTA=${FREE_DAILY_QUOTA:-20}
- MEMBER_DAILY_QUOTA=${MEMBER_DAILY_QUOTA:-60}
dimension-admin:
image: nginx:alpine
restart: unless-stopped
volumes:
- ./deploy/dist/admin:/usr/share/nginx/html:ro
- ./deploy/nginx/admin.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- "127.0.0.1:3010:80"
dimension-h5:
image: nginx:alpine
restart: unless-stopped
volumes:
- ./deploy/dist/h5:/usr/share/nginx/html:ro
- ./deploy/nginx/h5.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- "127.0.0.1:3020:80"
volumes:
mongo_data: