Files
mengyaping/mengyaping-backend/docker-compose.yml
2026-05-16 19:03:32 +08:00

45 lines
1.4 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.
# 生产:先在 Windows 运行 build-linux-amd64.bat 生成 dist/mengyaping-backend再 docker compose build镜像内不再编译 Go
# 若需在服务器上用源码构建镜像docker build -f Dockerfile.source -t mengyaping-backend:source .
version: '3.8'
services:
mengyaping-backend:
build:
context: .
dockerfile: Dockerfile
container_name: mengyaping-backend
restart: unless-stopped
ports:
- "6161:8080"
volumes:
# 持久化数据目录
- /shumengya/docker/mengyaping-backend/data/:/app/data
environment:
# 服务器配置
- SERVER_PORT=8080
- SERVER_HOST=0.0.0.0
# 监控默认值(首次写入 MySQL monitor_kv周期也可在管理后台改须为 10/20/30/60/180/360 分钟之一)
- MONITOR_INTERVAL=30m
- MONITOR_TIMEOUT=10s
- MONITOR_RETRY_COUNT=3
- MONITOR_HISTORY_DAYS=7
# 若设置则覆盖数据库 monitor_kv 中的 admin_token部署密文推荐用环境变量
- ADMIN_TOKEN=shumengya520
networks:
- mengyaping-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/api/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
mengyaping-network:
driver: bridge