-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathdocker-compose.yml
180 lines (172 loc) · 6.39 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
version: "3.9"
services:
# default insights-bot service that would pull the image from docker hub
# and runs on production environment with db_local service and redis_local
# service
#
# you need to use either docker compose up --profile hub -d or docker-compose --profile hub up -d
# to ask docker compose to run this service
insights_bot:
profiles:
- hub
image: ghcr.io/nekomeowww/insights-bot:latest
restart: always
environment:
- TIMEZONE_SHIFT_SECONDS
- TELEGRAM_BOT_TOKEN
# # uncomment the following lines if you configured telegram webhook in .env file
# - TELEGRAM_BOT_WEBHOOK_URL
# - TELEGRAM_BOT_WEBHOOK_PORT
- OPENAI_API_SECRET
- OPENAI_API_HOST
- OPENAI_API_MODEL_NAME
- OPENAI_API_TOKEN_LIMIT
- OPENAI_API_CHAT_HISTORIES_RECAP_TOKEN_LIMIT
- DB_CONNECTION_STR
- REDIS_HOST=redis_local
- REDIS_PORT=6379
- REDIS_TLS_ENABLED=false
- REDIS_PASSWORD=123456
- REDIS_CLIENT_CACHE_ENABLED
- LOG_LEVEL
# # uncomment the following lines if you configured slack and it's webhook options in .env file
# - SLACK_CLIENT_ID
# - SLACK_CLIENT_SECRET
# - SLACK_WEBHOOK_PORT
# # uncomment the following lines if you configured discord bot webhook in .env file
# - DISCORD_BOT_TOKEN
# - DISCORD_BOT_PUBLIC_KEY
# - DISCORD_BOT_WEBHOOK_PORT
ports:
- 7069:7069
- 7070:7070
# - ${DISCORD_BOT_WEBHOOK_PORT}:${DISCORD_BOT_WEBHOOK_PORT} # uncomment this line if you have set DISCORD_BOT_WEBHOOK_PORT in .env file
healthcheck:
test: curl --fail http://localhost:7069/health || exit 1
interval: 1s
retries: 5
start_period: 1s
timeout: 1s
volumes:
- insights_bot_logs:/var/log/insights-bot
depends_on:
- db_local
- redis_local
# On-demand build insights-bot service that would build the image from
# source code and runs on production environment with db_local service
# and redis_local service
#
# you need to use either docker compose up --profile local -d or docker-compose --profile local up -d
# to ask docker compose to run this service
insights_bot_local:
profiles:
- local
build:
context: .
dockerfile: ./Dockerfile
image: insights-bot
restart: always
environment:
- TIMEZONE_SHIFT_SECONDS
- TELEGRAM_BOT_TOKEN
# # uncomment the following lines if you configured telegram webhook in .env file
# - TELEGRAM_BOT_WEBHOOK_URL
# - TELEGRAM_BOT_WEBHOOK_PORT
- OPENAI_API_SECRET
- OPENAI_API_HOST
- OPENAI_API_MODEL_NAME
- OPENAI_API_TOKEN_LIMIT
- OPENAI_API_CHAT_HISTORIES_RECAP_TOKEN_LIMIT
- DB_CONNECTION_STR
- REDIS_HOST=redis_local
- REDIS_PORT=6379
- REDIS_TLS_ENABLED=false
- REDIS_PASSWORD=123456
- REDIS_CLIENT_CACHE_ENABLED
- LOG_LEVEL
# # uncomment the following lines if you configured slack and it's webhook options in .env file
# - SLACK_CLIENT_ID
# - SLACK_CLIENT_SECRET
# - SLACK_WEBHOOK_PORT
# # uncomment the following lines if you configured discord bot webhook in .env file
# - DISCORD_BOT_TOKEN
# - DISCORD_BOT_PUBLIC_KEY
# - DISCORD_BOT_WEBHOOK_PORT
ports:
- 7069:7069
- 7070:7070
# - ${DISCORD_BOT_WEBHOOK_PORT}:${DISCORD_BOT_WEBHOOK_PORT} # uncomment this line if you have set DISCORD_BOT_WEBHOOK_PORT in .env file
healthcheck:
test: curl --fail http://localhost:7069/health || exit 1
interval: 10s
retries: 5
timeout: 5s
volumes:
- insights_bot_logs:/var/log/insights-bot
depends_on:
- db_local
- redis_local
# the default PostgreSQL database service that helps insights-bot to store data
# you can change the password by changing the POSTGRES_PASSWORD environment variable
# and change the database name by changing the POSTGRES_DB environment variable
# and change the username by changing the POSTGRES_USER environment variable
#
# NOTICE: if you have your own PostgreSQL database service, you can remove this service
# and change the DB_CONNECTION_STR environment variable in insights_bot or
# insights_bot_local service
db_local:
image: postgres:alpine
restart: unless-stopped
environment:
- POSTGRES_PASSWORD=123456
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
volumes:
- ./.postgres/data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $$POSTGRES_DB -U $$POSTGRES_USER" ]
interval: 10s
timeout: 5s
retries: 5
# the default Redis service that helps insights-bot to store data
# you can change the password by changing the REDIS_PASSWORD environment variable
# and change the port by changing the REDIS_PORT environment variable
#
# NOTICE: if you have your own Redis service, you can remove this service
# and change the REDIS_HOST and REDIS_PORT environment variable in insights_bot or
# insights_bot_local service
redis_local:
image: redis:7
restart: unless-stopped
environment:
- REDIS_PASSWORD=123456
command: >
/bin/sh -c "redis-server $${REDIS_PASSWORD:+--requirepass \"$$REDIS_PASSWORD\"}"
healthcheck:
test: [ "CMD-SHELL", "redis-cli -e $${REDIS_PASSWORD:+-a \"$$REDIS_PASSWORD\"} --no-auth-warning ping" ]
interval: 10s
timeout: 5s
retries: 5
# # promtail service that helps insights-bot to collect logs
# # you can uncomment the following lines if you want to enable promtail
# promtail:
# image: grafana/promtail:2.8.2
# restart: unless-stopped
# volumes:
# - ./production/promtail:/etc/promtail # you may edit the ./production/promtail/config.yaml file to suit your needs
# - insights_bot_logs:/var/log/insights-bot:ro
# command: >
# -config.file=/etc/promtail/config.yaml
# # uncomment the following lines if you want to view the web ui of promtail
# # ports:
# # - 9080:9080
# # uncomment the following lines if you want to use your own loki service
# # networks:
# # - <loki_network> # replace <loki_network> with your own loki network name
volumes:
insights_bot_logs:
# uncomment the following lines if you want to use your own loki service
# that live in another docker-compose.yml file
# networks:
# <loki_network>: # replace <loki_network> with your own loki network name
# external: true