lolly/docker-compose.yml
xfy 55c05ec41d feat(docker): 添加容器化部署支持
- Dockerfile: 多阶段构建,最小化镜像体积(scratch)
- docker-compose.yml: 开发环境配置,含健康检查
- .dockerignore: 排除不必要的构建上下文

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 16:56:10 +08:00

41 lines
1.0 KiB
YAML
Raw Permalink 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.

services:
lolly:
build: .
# 防止僵尸进程lolly 无 PID 1 处理)
init: true
ports:
- "8080:8080"
# HTTP/3 (QUIC) - 需要 SSL 证书
# - "443:443/tcp"
# - "443:443/udp"
volumes:
- ./lolly.yaml:/etc/lolly/lolly.yaml:ro
# 静态文件目录
- ./html:/var/www/html:ro
# SSL 证书(可选)
# - ./certs:/etc/lolly/certs:ro
# 日志持久化(可选)
# - ./logs:/var/log/lolly
environment:
# 配合容器内存限制设置 GC 目标
- GOMEMLIMIT=750MiB
# 资源限制(可选)
# deploy:
# resources:
# limits:
# memory: 1G
# reservations:
# memory: 256M
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:8080/_status || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# 示例后端服务(用于反向代理测试)
# backend:
# image: nginx:alpine
# ports:
# - "8000:80"