-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
docker-compose.yml
68 lines (65 loc) · 1.67 KB
/
docker-compose.yml
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
version: "3"
services:
redis:
image: redis:7-alpine
environment:
- TZ=Asia/Shanghai
- REDIS_PASSWORD=${REDIS_PASSWORD:?err}
command: ["sh", "-c", "redis-server --requirepass $$REDIS_PASSWORD"]
volumes:
- bot_redis_data:/data
restart: always
postgres:
image: postgres:15-alpine
environment:
- POSTGRES_USER=${POSTGRES_USER:?err}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?err}
- POSTGRES_DB=${POSTGRES_DB:?err}
- POSTGRES_INITDB_ARGS="--encoding=UTF8"
- TZ=Asia/Shanghai
volumes:
- bot_postgres_data:/var/lib/postgresql/data
restart: always
nonebot:
image: cscs181/qq-github-bot:latest # docker hub
# image: ghcr.io/cscs181/qq-github-bot:latest # github image mirror
# build: . # use "build" instead of "image" if you want to build the image yourself
env_file:
- .env
environment:
- ENVIRONMENT=prod
- HOST=${HOST:-0.0.0.0}
- PORT=${PORT:-8086}
- MAX_WORKERS=1 # maximum workers
- REDIS_HOST=redis
- REDIS_PORT=6379
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
depends_on:
- redis
- postgres
deploy:
resources:
limits:
memory: 1024M
reservations:
memory: 512M
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${PORT:-8086}/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
restart: always
go-cqhttp:
image: ghcr.io/mrs4s/go-cqhttp:latest
volumes:
- "./bot:/data"
depends_on:
- nonebot
restart: always
profiles:
- go-cqhttp
volumes:
bot_redis_data: {}
bot_postgres_data: {}