-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
163 lines (153 loc) · 3.64 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
services:
server:
build:
context: .
dockerfile: ./rag_backend/Dockerfile
container_name: server_container
command: bash -c "python ./rag_backend/manage.py migrate && python ./rag_backend/manage.py runserver 0.0.0.0:8000"
ports:
- 8000:8000
env_file:
- ./rag_backend/.env
depends_on:
postgres:
condition: service_healthy
volumes:
# still need changes in CreateSummary
- ~/.cache/huggingface/hub/:/root/.cache/huggingface/hub
deploy:
resources:
limits:
cpus: '4'
memory: 10G
networks:
- postgres
- qdrant
qdrant:
image: qdrant/qdrant:latest
restart: always
container_name: qdrant
ports:
- "6333:6333"
- "6334:6334"
expose:
- 6333
- 6334
- 6335
# configs:
# - source: qdrant_config
# target: /qdrant/config/production.yaml
volumes:
- ./qdrant_data:/qdrant/storage
networks:
- qdrant
postgres:
container_name: postgres_container
image: postgres:16.3-alpine3.18
command:
- "postgres"
- "-c"
- "max_connections=50"
- "-c"
- "shared_buffers=1GB"
- "-c"
- "effective_cache_size=4GB"
- "-c"
- "work_mem=16MB"
- "-c"
- "maintenance_work_mem=512MB"
- "-c"
- "random_page_cost=1.1"
- "-c"
- "temp_file_limit=10GB"
- "-c"
- "log_min_duration_statement=200ms"
- "-c"
- "idle_in_transaction_session_timeout=10s"
- "-c"
- "lock_timeout=1s"
- "-c"
- "statement_timeout=60s"
- "-c"
- "shared_preload_libraries=pg_stat_statements"
- "-c"
- "pg_stat_statements.max=10000"
- "-c"
- "pg_stat_statements.track=all"
environment:
POSTGRES_DB: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
GDATA: "/var/lib/postgresql/data/pgdata"
volumes:
- ../2. Init Database:/docker-entrypoint-initdb.d
- db-data:/var/lib/postgresql/data
ports:
- "6432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres -d postgres" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1'
memory: 1G
networks:
- postgres
pgadmin:
container_name: pgadmin_container
image: dpage/pgadmin4:8.8
environment:
PGADMIN_DEFAULT_EMAIL: "[email protected]"
PGADMIN_DEFAULT_PASSWORD: "postgres"
PGADMIN_CONFIG_SERVER_MODE: "True" # To allow running in desktop mode
volumes:
- pgadmin-data:/var/lib/pgadmin
ports:
- "5050:80"
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.5'
memory: 1G
networks:
- postgres
postgres_exporter:
container_name: exporter_container
image: prometheuscommunity/postgres-exporter:v0.15.0
environment:
DATA_SOURCE_URI: "postgres:5432/postgres?sslmode=disable"
DATA_SOURCE_USER: "postgres"
DATA_SOURCE_PASS: "postgres"
PG_EXPORTER_EXTEND_QUERY_PATH: "/etc/postgres_exporter/queries.yaml"
volumes:
- ./queries.yaml:/etc/postgres_exporter/queries.yaml:ro
ports:
- "9187:9187"
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.2'
memory: 500M
networks:
- postgres
volumes:
db-data:
pgadmin-data:
transformers:
qdrant-data:
networks:
postgres:
driver: bridge
qdrant:
driver: bridge
# configs:
# qdrant_config:
# content: |
# log_level: INFO