forked from techfish-11/SwiftlyTTS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
94 lines (87 loc) · 2.79 KB
/
docker-compose.yml
File metadata and controls
94 lines (87 loc) · 2.79 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# SwiftlyTTS ボット + Postgres + Voicevox 用の docker-compose
# 使用方法:
# - 開始: docker compose up -d
# - 停止: docker compose down
# 注意事項:
# - シークレット情報はプロジェクトルートの .env ファイルに保存するか、環境変数で渡してください。
# - .env ファイルに必要な env (例):
# DISCORD_TOKEN=your_token_here
# SHARD_COUNT=3
# DB_NAME=swiftlytts
# DB_USER=swiftlytts
# DB_PASSWORD=change-me
# - VOICEVOX: Compose はデフォルトで公式エンジンイメージ名を使用します。必要に応じてタグを変更してください。
version: '3.8'
services:
postgres:
image: postgres:15-alpine
container_name: swiftlytts-postgres
environment:
POSTGRES_DB: ${DB_NAME:-swiftlytts}
POSTGRES_USER: ${DB_USER:-swiftlytts}
POSTGRES_PASSWORD: ${DB_PASSWORD:-swiftlytts}
volumes:
- db_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-swiftlytts}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
voicevox:
image: voicevox/voicevox_engine:latest
container_name: swiftlytts-voicevox
environment:
VOICEVOX_ENGINE_TTS_PORT: 50021
ports:
- "50021:50021" # API
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:50021/ || exit 1"]
interval: 10s
timeout: 5s
retries: 6
bot:
build:
context: .
dockerfile: Dockerfile
container_name: swiftlytts-bot
env_file:
- .env
environment:
# DB_HOST は compose 内のサービス名を参照
DB_HOST: postgres
DB_PORT: 5432
# 以下は .env に設定されていれば上書きされます
DB_NAME: ${DB_NAME:-swiftlytts}
DB_USER: ${DB_USER:-swiftlytts}
DB_PASSWORD: ${DB_PASSWORD:-swiftlytts}
# VOICEVOX サーバーの URL。デフォルトは compose 内の voicevox サービスを指す
# 環境変数や .env で上書き可能(例: VOICEVOX_URL=http://external-voicevox:50021)
VOICEVOX_URL: ${VOICEVOX_URL:-http://voicevox:50021}
SHARD_COUNT: ${SHARD_COUNT:-3}
# DISCORD_TOKEN は .env や環境変数で提供してください
depends_on:
postgres:
condition: service_healthy
voicevox:
condition: service_healthy
volumes:
- ./:/app # 開発時にソースを反映させたい場合は有効。プロダクションでは外すことを推奨
restart: unless-stopped
adminer:
image: adminer
container_name: swiftlytts-adminer
ports:
- "8080:8080"
restart: unless-stopped
depends_on:
- postgres
volumes:
db_data:
name: swiftlytts_db_data
networks:
default:
name: swiftlytts_default