-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
70 lines (65 loc) · 1.59 KB
/
docker-compose.yml
File metadata and controls
70 lines (65 loc) · 1.59 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
version: '3.8'
services:
# MongoDB Database
mongodb:
image: mongo:7.0
container_name: codementor_mongodb
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password
MONGO_INITDB_DATABASE: codementor_ai
volumes:
- mongodb_data:/data/db
networks:
- codementor_network
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
# FastAPI Backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: codementor_backend
ports:
- "8000:8000"
environment:
MONGODB_URL: mongodb://admin:password@mongodb:27017
MONGODB_DATABASE: codementor_ai
GROQ_API_KEY: ${GROQ_API_KEY}
LANGSMITH_API_KEY: ${LANGSMITH_API_KEY}
ENVIRONMENT: development
depends_on:
mongodb:
condition: service_healthy
volumes:
- ./backend:/app
networks:
- codementor_network
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
# Frontend Development Server
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: codementor_frontend
ports:
- "5173:5173"
environment:
VITE_API_BASE_URL: http://localhost:8000
VITE_WS_URL: ws://localhost:8000
volumes:
- ./frontend:/app
- /app/node_modules
networks:
- codementor_network
command: npm run dev
volumes:
mongodb_data:
networks:
codementor_network:
driver: bridge