This commit is contained in:
38
script/docker/docker-compose.prod.yml
Normal file
38
script/docker/docker-compose.prod.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
# 生产环境 Docker Compose 配置
|
||||
# 注意:数据库和 Redis 使用外部服务,不在此文件中定义
|
||||
# 前端静态文件由 Nginx 直接托管,不使用 Docker
|
||||
|
||||
version: "3.8"
|
||||
|
||||
name: sionrui-prod
|
||||
|
||||
services:
|
||||
# 后端服务
|
||||
backend:
|
||||
container_name: sionrui-backend
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: yudao-server/Dockerfile
|
||||
image: sionrui-backend:latest
|
||||
restart: always
|
||||
ports:
|
||||
- "9900:9900"
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- SPRING_PROFILES_ACTIVE=prod
|
||||
- JAVA_OPTS=-Xms1g -Xmx1g -XX:+HeapDumpOnOutOfMemoryError
|
||||
volumes:
|
||||
- /www/wwwroot/yudao-server/logs:/app/logs
|
||||
- /www/wwwroot/yudao-server/heapError:/app/heapError
|
||||
- /www/wwwroot/yudao-server/config:/app/config
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9900/actuator/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 60s
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "100m"
|
||||
max-file: "3"
|
||||
Reference in New Issue
Block a user