-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
118 lines (112 loc) · 3.21 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
118 lines (112 loc) · 3.21 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
# Development configuration with hot-reload and volume mounts
# Usage: docker compose -f docker-compose.dev.yml up
services:
llm-gateway:
build:
context: .
dockerfile: Dockerfile
args:
USER_ID: ${UID:-1000}
GROUP_ID: ${GID:-1000}
command: uvicorn app.http_server.ingress:app --host 0.0.0.0 --port 8000 --reload
env_file:
- .env
volumes:
- ./app:/usr/src/app
- ./tests:/usr/src/tests
- ./templates:/usr/src/templates
- ./seeds:/usr/src/seeds
- ${TOKENIZER_STORAGE_PATH:-./tokenizers}:/var/www/data/tokenizers
- templates_data:/var/www/data/templates
networks:
- llm-network
ports:
- 8000:8000
depends_on:
postgres:
condition: service_healthy
task-broker-redis:
condition: service_started
celery-worker:
build:
context: .
dockerfile: Dockerfile
args:
USER_ID: ${UID:-1000}
GROUP_ID: ${GID:-1000}
command: celery -A app.http_server.celery_app.celery_app worker --loglevel=info --concurrency=1
env_file:
- .env
volumes:
- ./app:/usr/src/app
- ./templates:/usr/src/templates
- ./seeds:/usr/src/seeds
- ${TOKENIZER_STORAGE_PATH:-./tokenizers}:/var/www/data/tokenizers
- templates_data:/var/www/data/templates
networks:
- llm-network
depends_on:
postgres:
condition: service_healthy
task-broker-redis:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "./scripts/celery-healthcheck.sh"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
deploy:
replicas: ${CELERY_WORKERS:-1}
frontend:
# Development mode with hot-reload, no basePath (runs at root)
# Access at: http://localhost:8001
build:
context: ./frontend
dockerfile: Dockerfile.dev
args:
USER_ID: ${UID:-1000}
GROUP_ID: ${GID:-1000}
environment:
# API/WS URLs required when frontend and backend are on different ports
- NEXT_PUBLIC_API_URL=http://localhost:8000
- NEXT_PUBLIC_WS_URL=ws://localhost:8000
networks:
- llm-network
ports:
- "8001:3000"
depends_on:
- llm-gateway
volumes:
- ./frontend:/app
- frontend_node_modules:/app/node_modules
- frontend_next:/app/.next
task-broker-redis:
command: /bin/sh -c "redis-stack-server --requirepass ${REDIS_PASSWORD:-changeme}"
image: redis/redis-stack-server:latest
networks:
- llm-network
postgres:
image: postgres:15-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-llm_gateway}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-llm_gateway_password}
POSTGRES_DB: ${POSTGRES_DB:-llm_gateway}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- llm-network
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-llm_gateway}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data:
templates_data:
frontend_node_modules:
frontend_next:
networks:
llm-network: