-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (71 loc) · 2 KB
/
docker-compose.yml
File metadata and controls
75 lines (71 loc) · 2 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
name: querygpt
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: querygpt
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d querygpt"]
interval: 5s
timeout: 5s
retries: 10
api:
build:
context: .
dockerfile: docker/Dockerfile.api
working_dir: /workspace/apps/api
environment:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@db:5432/querygpt
HOST: 0.0.0.0
PORT: "8000"
ENVIRONMENT: development
DEBUG: "true"
ENCRYPTION_KEY: "docker-dev-key-min-32-bytes-long!!"
LOG_FORMAT: console
CORS_ORIGINS_STR: http://localhost:3000,http://127.0.0.1:3000
MPLBACKEND: Agg
ports:
- "8000:8000"
volumes:
- ./apps/api:/workspace/apps/api
depends_on:
db:
condition: service_healthy
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health')"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
web:
build:
context: .
dockerfile: docker/Dockerfile.web
working_dir: /workspace/apps/web
environment:
NEXT_PUBLIC_API_URL: http://localhost:8000
INTERNAL_API_URL: http://api:8000
WATCHPACK_POLLING: "true"
CHOKIDAR_USEPOLLING: "true"
ports:
- "3000:3000"
volumes:
- ./apps/web:/workspace/apps/web
- web_node_modules:/workspace/apps/web/node_modules
- web_next:/workspace/apps/web/.next
depends_on:
api:
condition: service_healthy
entrypoint: ["/bin/sh", "/opt/querygpt/scripts/web-bootstrap.sh"]
command: ["npm", "run", "dev", "--", "--hostname", "0.0.0.0", "--port", "3000"]
volumes:
pgdata:
web_node_modules:
web_next: