forked from chatvector-ai/chatvector-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
60 lines (56 loc) · 1.47 KB
/
Copy pathdocker-compose.yml
File metadata and controls
60 lines (56 loc) · 1.47 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
version: "3.9"
services:
db:
image: pgvector/pgvector:pg16
container_name: chatvector-db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
volumes:
- chatvector-db-data:/var/lib/postgresql/data
- ./backend/db/init:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 2s
retries: 10
start_period: 5s
api:
build:
context: ./backend
container_name: chatvector-api
depends_on:
db:
condition: service_healthy
ports:
- "8000:8000"
environment:
# 👇 Fixed: Using asyncpg for async support
DATABASE_URL: "postgresql+asyncpg://postgres:postgres@db:5432/postgres"
APP_ENV: "development"
PYTHONPATH: /app
working_dir: /app
volumes:
- ./backend:/app
command: ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
tests:
build:
context: ./backend
container_name: chatvector-tests
working_dir: /app
volumes:
- ./backend:/app
environment:
# 👇 Same fix here
DATABASE_URL: "postgresql+asyncpg://postgres:postgres@db:5432/postgres"
APP_ENV: "test"
PYTHONPATH: /app
depends_on:
db:
condition: service_healthy
command: ["pytest", "-v", "--asyncio-mode=auto"] # 👈 Added asyncio mode
volumes:
chatvector-db-data: