-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.external-db.yml
More file actions
38 lines (32 loc) · 1.07 KB
/
docker-compose.external-db.yml
File metadata and controls
38 lines (32 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 外挂数据库部署模板
# 使用方式:
# 1. 复制本文件并填写数据库连接信息
# 2. 初始化数据库:mysql -u root -p < install.sql
# 3. 启动:docker-compose -f docker-compose.external-db.yml up -d
version: '3.8'
services:
webssh:
image: dalaolala/webssh:latest
container_name: webssh-app
ports:
- "3000:3000"
environment:
# 数据库配置(填写你的外部 MySQL 信息)
- DB_HOST=your-mysql-host
- DB_PORT=3306
- DB_USER=webssh_user
- DB_PASSWORD=your-db-password
- DB_NAME=webssh
# 安全配置(请替换为强随机值,部署后不可更改)
- JWT_SECRET=your-jwt-secret
- ENCRYPTION_KEY=your-32-byte-encryption-key
# 运行环境
- NODE_ENV=production
- PORT=3000
restart: unless-stopped
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/api/auth/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s