-
-
Notifications
You must be signed in to change notification settings - Fork 640
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (70 loc) · 1.93 KB
/
docker-compose.yml
File metadata and controls
74 lines (70 loc) · 1.93 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
services:
gpt-load:
image: ghcr.io/tbphp/gpt-load:latest
# build:
# context: .
# dockerfile: Dockerfile
container_name: gpt-load
ports:
- "${PORT:-3001}:${PORT:-3001}"
env_file:
- .env
restart: always
volumes:
- ./data:/app/data
stop_grace_period: ${SERVER_GRACEFUL_SHUTDOWN_TIMEOUT:-10}s
healthcheck:
test: wget -q --spider -T 10 -O /dev/null http://localhost:${PORT:-3001}/health
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# depends_on:
# mysql:
# condition: service_healthy
# restart: true
# postgres:
# condition: service_healthy
# restart: true
# redis:
# condition: service_healthy
# restart: true
# 如果需要安装 MySQL、PostgreSQL 或 Redis,请取消以下注释并配置相应的环境变量。
# 并且要在上方的depends_on中取消注释相应的依赖服务。
# mysql:
# image: mysql:8.2
# container_name: gpt-load-mysql
# restart: always
# environment:
# MYSQL_ROOT_PASSWORD: 123456
# MYSQL_DATABASE: gpt-load
# volumes:
# - ./data/mysql:/var/lib/mysql
# healthcheck:
# test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
# interval: 5s
# timeout: 5s
# retries: 10
# postgres:
# image: "postgres:16"
# container_name: gpt-load-postgres
# environment:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: 123456
# POSTGRES_DB: gpt-load
# volumes:
# - ./data/postgres:/var/lib/postgresql/data
# healthcheck:
# test: ["CMD-SHELL", "pg_isready -U postgres -d gpt-load"]
# interval: 5s
# timeout: 5s
# retries: 10
# redis:
# image: redis:latest
# container_name: gpt-load-redis
# restart: always
# healthcheck:
# test: ["CMD", "redis-cli", "ping"]
# interval: 5s
# timeout: 3s
# retries: 3