PayrollManagementSystem/docker/docker-compose.tplus.dev.yml
liuwenxin ee801652e3 fix(运维): 限制 T+ 开发库端口仅本机访问
SQL Server 容器还原的是客户真实账套且带 sa 账号,1433 端口
原先绑定全部网卡会暴露到局域网。改为 127.0.0.1 回环地址,
与 MySQL 开发库的绑定先例保持一致,宿主机访问不受影响。

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-30 09:56:13 +08:00

44 lines
1.5 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.

# T+ SQL Server 恢复 PoC
#
# 使用前:
# 1. 复制 docker/tplus.env.example 为 D:\work\app\tplus-sqlserver\.env;
# 2. 将客户 .bak 放入 D:\work\app\tplus-sqlserver\backup;
# 3. SQL Server 数据、日志和备份通过绑定目录写入 D 盘;不修改 Docker Desktop 的磁盘镜像设置。
name: ys-payroll-tplus
services:
tplus-sqlserver:
image: ${TPLUS_SQLSERVER_IMAGE:-mcr.microsoft.com/mssql/server:2022-CU16-ubuntu-22.04}
container_name: ys-tplus-sqlserver-dev
restart: unless-stopped
environment:
ACCEPT_EULA: "Y"
MSSQL_PID: Developer
MSSQL_SA_PASSWORD: ${TPLUS_SA_PASSWORD:?请在 D:/work/app/tplus-sqlserver/.env 设置 TPLUS_SA_PASSWORD}
TZ: Asia/Shanghai
ports:
- "127.0.0.1:1433:1433"
volumes:
- type: bind
source: ${TPLUS_ROOT:-D:/work/app/tplus-sqlserver}/data
target: /var/opt/mssql/data
- type: bind
source: ${TPLUS_ROOT:-D:/work/app/tplus-sqlserver}/log
target: /var/opt/mssql/log
- type: bind
source: ${TPLUS_ROOT:-D:/work/app/tplus-sqlserver}/backup
target: /var/opt/mssql/backup
read_only: true
- type: bind
source: ${TPLUS_ROOT:-D:/work/app/tplus-sqlserver}/scripts
target: /opt/tplus/scripts
read_only: true
healthcheck:
test:
- CMD-SHELL
- /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$${MSSQL_SA_PASSWORD}" -C -Q "SELECT 1" >/dev/null 2>&1
interval: 10s
timeout: 5s
retries: 20
start_period: 30s