Files
hms/docker/docker-compose.cloud.yml
iven d5ec250184 feat(docker): 云端部署配置 — host 网络模式 + 环境变量模板
- Dockerfile: Rust 版本升级为 latest stable, 添加 curl (healthcheck),
  前端产物 VOLUME 暴露供 OpenResty 挂载
- docker-compose.cloud.yml: 仅 app 容器, host 网络直连宿主机 PG/Redis
- .env.production.example: 环境变量模板含必填/可选项注释
2026-05-17 15:06:53 +08:00

41 lines
1.1 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.
# 云端部署配置 — 仅启动应用容器PG/Redis 使用宿主机已安装的服务
# 使用方式: docker compose -f docker/docker-compose.cloud.yml up -d
#
# 前置条件:
# 1. 宿主机已安装 PostgreSQL 16 + Redis 7
# 2. PostgreSQL 已创建数据库和用户
# 3. 复制 .env.production.example 为 .env.production 并填写实际值
# 4. OpenResty 反代配置:
# - /api/* → http://localhost:3000
# - /uploads/* → http://localhost:3000
# - / → 前端静态文件 (挂载 /opt/hms/static/)
services:
app:
build:
context: ..
dockerfile: Dockerfile
container_name: hms-server
restart: unless-stopped
network_mode: host
env_file:
- .env.production
volumes:
- ../uploads:/app/uploads
- ../config:/app/config:ro
- ../static:/app/static
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/v1/health"]
interval: 30s
timeout: 5s
start_period: 60s
retries: 3
deploy:
resources:
limits:
cpus: "2"
memory: 1024M
reservations:
cpus: "0.5"
memory: 256M