web打包修改
This commit is contained in:
14
docker/urbanLifeline/nginx/.env.example
Normal file
14
docker/urbanLifeline/nginx/.env.example
Normal file
@@ -0,0 +1,14 @@
|
||||
# ------------------------------
|
||||
# 挂载目录配置
|
||||
# ------------------------------
|
||||
# 数据目录
|
||||
DATA_ROOT=./volumes
|
||||
|
||||
# 配置文件目录
|
||||
CONFIG_ROOT=./volumes
|
||||
|
||||
# 配置文件位置
|
||||
CONFIG_FILE_ROOT=./volumes
|
||||
|
||||
# SSL证书目录
|
||||
SSL_ROOT=
|
||||
@@ -17,11 +17,11 @@ services:
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- ./volumes/nginx/logs:/var/log/nginx
|
||||
- ./volumes/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./volumes/conf.d:/etc/nginx/conf.d:ro
|
||||
- ${LOG_ROOT:-./volumes/nginx/logs}:/var/log/nginx
|
||||
- ${CONFIG_FILE_ROOT:-./volumes/nginx.conf}:/etc/nginx/nginx.conf:ro
|
||||
- ${CONFIG_ROOT:-./volumes/conf.d}:/etc/nginx/conf.d:ro
|
||||
# SSL 证书(可选)
|
||||
- ./volumes/cert:/etc/nginx/ssl:ro
|
||||
- ${SSL_ROOT:-./volumes/cert}:/etc/nginx/ssl:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost/health"]
|
||||
interval: 30s
|
||||
@@ -125,7 +125,7 @@ server {
|
||||
|
||||
# 后端 API 代理
|
||||
location /urban-lifeline/ {
|
||||
proxy_pass http://gateway/;
|
||||
proxy_pass http://gateway;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@@ -148,3 +148,4 @@ server {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,31 @@
|
||||
# ================================================
|
||||
|
||||
services:
|
||||
# ====================== Redis 缓存 ======================
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: urban-lifeline-redis
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- urban-lifeline
|
||||
expose:
|
||||
- "6379"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-redis123}
|
||||
volumes:
|
||||
- ${REDIS_DATA:-./volumes/redis}:/data
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: ${REDIS_MEMORY_LIMIT:-512M}
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-redis123}", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
|
||||
# ====================== 后端服务 ======================
|
||||
urban-lifeline-serv:
|
||||
image: urban-lifeline-serv:${IMAGE_VERSION:-latest}
|
||||
container_name: urban-lifeline-serv
|
||||
@@ -12,13 +37,20 @@ services:
|
||||
- .env
|
||||
networks:
|
||||
- urban-lifeline
|
||||
ports:
|
||||
- "${GATEWAY_PORT:-8080}:8080"
|
||||
# 不对外暴露端口,仅通过 nginx 反向代理访问
|
||||
expose:
|
||||
- "8080"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE:-prod}
|
||||
NACOS_SERVER_ADDR: ${NACOS_SERVER_ADDR:-nacos:8848}
|
||||
NACOS_NAMESPACE: ${NACOS_NAMESPACE:-}
|
||||
REDIS_HOST: urban-lifeline-redis
|
||||
REDIS_PORT: 6379
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD:-redis123}
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
# 配置文件目录
|
||||
- ${CONFIG_ROOT:-./volumes/config}:/app/config:ro
|
||||
|
||||
@@ -12,12 +12,13 @@ services:
|
||||
- .env
|
||||
networks:
|
||||
- urban-lifeline
|
||||
ports:
|
||||
- "${SHARED_PORT:-8000}:8000"
|
||||
- "${PLATFORM_PORT:-8001}:8001"
|
||||
- "${WORKCASE_PORT:-8002}:8002"
|
||||
- "${BIDDING_PORT:-8003}:8003"
|
||||
- "${WORKCASE_WECHAT_PORT:-8004}:8004"
|
||||
# 不对外暴露端口,仅通过 nginx 反向代理访问
|
||||
expose:
|
||||
- "8000"
|
||||
- "8001"
|
||||
- "8002"
|
||||
- "8003"
|
||||
- "8004"
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
SHARED_PORT: ${SHARED_PORT:-8000}
|
||||
|
||||
Reference in New Issue
Block a user