novel-reader/docker-compose.yml
2025-12-06 18:19:46 +08:00

40 lines
1.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: '3.8'
services:
novel-reader:
build: .
# 如果已经构建好镜像,可以直接使用镜像名
# image: novel-reader:latest
container_name: novel-reader
restart: unless-stopped
ports:
- "8080:8080"
environment:
# MongoDB连接配置 - 根据你的实际情况修改
- SPRING_DATA_MONGODB_URI=mongodb://192.168.18.100:38403/novel
# JVM内存配置根据NAS内存调整
- JAVA_OPTS=-Xms128m -Xmx256m -XX:+UseG1GC
# 时区
- TZ=Asia/Shanghai
# 健康检查
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/novels/tags/popular?limit=1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# 日志配置
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# 资源限制可选根据NAS配置调整
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 256M