-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
125 lines (118 loc) · 3.42 KB
/
Copy pathdocker-compose.yml
File metadata and controls
125 lines (118 loc) · 3.42 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
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
name: doc-007-ai
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-doc007}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-doc007}
POSTGRES_DB: ${POSTGRES_DB:-doc007}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-doc007} -d ${POSTGRES_DB:-doc007}"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
qdrant:
image: qdrant/qdrant:latest
ports:
- "6333:6333"
- "6334:6334"
volumes:
- qdrantdata:/qdrant/storage
healthcheck:
test: ["CMD-SHELL", "bash -c ':> /dev/tcp/127.0.0.1/6333' || exit 1"]
interval: 10s
timeout: 5s
retries: 10
api:
build:
context: ./apps/api
dockerfile: Dockerfile
# Uses the final `runtime` stage: uvicorn/celery are on PATH and
# PYTHONPATH=/app/src points at the bind-mounted source below, so
# --reload picks up host edits without an editable install.
target: runtime
env_file: .env
environment:
# override hosts so the API reaches services by their compose names
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-doc007}:${POSTGRES_PASSWORD:-doc007}@postgres:5432/${POSTGRES_DB:-doc007}
REDIS_URL: redis://redis:6379/0
CELERY_BROKER_URL: redis://redis:6379/1
CELERY_RESULT_BACKEND: redis://redis:6379/2
QDRANT_URL: http://qdrant:6333
ports:
- "8000:8000"
volumes:
- ./apps/api:/app
- uploads:/data/uploads
command: uvicorn doc007.main:app --host 0.0.0.0 --port 8000 --reload
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_started
worker:
build:
context: ./apps/api
dockerfile: Dockerfile
target: runtime
env_file: .env
environment:
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-doc007}:${POSTGRES_PASSWORD:-doc007}@postgres:5432/${POSTGRES_DB:-doc007}
REDIS_URL: redis://redis:6379/0
CELERY_BROKER_URL: redis://redis:6379/1
CELERY_RESULT_BACKEND: redis://redis:6379/2
QDRANT_URL: http://qdrant:6333
volumes:
- ./apps/api:/app
- uploads:/data/uploads
command: celery -A doc007.workers.celery_app.celery_app worker --loglevel=info
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_started
web:
build:
context: ./apps/web
dockerfile: Dockerfile
# The production Dockerfile's final `runner` stage ships a standalone
# bundle without a dev node_modules tree. For local dev we build the
# `deps` stage instead, which has the full node_modules that the
# anonymous volume below seeds, then run `npm run dev` over the
# bind-mounted source.
target: deps
environment:
NEXT_PUBLIC_API_BASE_URL: http://localhost:8000
ports:
- "3000:3000"
volumes:
- ./apps/web:/app
- /app/node_modules
- /app/.next
command: npm run dev
depends_on:
- api
volumes:
pgdata:
redisdata:
qdrantdata:
uploads: