Files
Lannamokia_vhdmount/VHDSelectServer/docker-compose.external-db.yml
Lannamokia 803e6cdaee feat: 添加PostgreSQL数据库集成和机台管理功能
- 新增PostgreSQL数据库支持,包含内置和外部数据库两种部署模式
- 实现机台管理功能,包括保护状态控制和VHD关键词设置
- 添加用户认证系统,支持会话管理和权限控制
- 更新Docker配置,支持数据库持久化和健康检查
- 扩展API接口,提供完整的RESTful API文档
- 更新客户端代码以支持机台ID和保护检查功能
- 添加数据库初始化脚本和配置指南
2025-10-21 20:10:18 +08:00

55 lines
1.3 KiB
YAML

version: '3.8'
services:
vhd-select-server:
image: lty271104/vhd-select-server:latest
ports:
- "8080:8080"
volumes:
- ./config:/app/config
- ./vhd-data:/app/vhd-data
environment:
# 应用配置
- NODE_ENV=production
- PORT=8080
- CONFIG_PATH=/app/config
# 数据库配置 - 使用外部数据库
- USE_EMBEDDED_DB=false
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=vhd_select
- DB_USER=postgres
- DB_PASSWORD=vhd_select_password
# 可选的数据库连接配置
- DB_MAX_CONNECTIONS=20
- DB_IDLE_TIMEOUT=30000
- DB_CONNECTION_TIMEOUT=5000
- DB_SSL=false
depends_on:
- postgres
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped
postgres:
image: postgres:15-alpine
environment:
- POSTGRES_DB=vhd_select
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=vhd_select_password
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
ports:
- "5432:5432"
restart: unless-stopped
volumes:
postgres_data:
driver: local