-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
72 lines (68 loc) · 1.99 KB
/
docker-compose.yml
File metadata and controls
72 lines (68 loc) · 1.99 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
# This file defines our application's services, networks, and volumes.
# 'services' are the different containers that make up our app.
services:
# 1. The PostgreSQL Database Service
db:
image: postgres:15-alpine
container_name: lab_db
environment:
- POSTGRES_USER=lab_user
- POSTGRES_PASSWORD=supersecretpassword
- POSTGRES_DB=lab_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U lab_user -d lab_db"]
interval: 5s
timeout: 5s
retries: 5
# 2. The Python Backend Service (FastAPI)
backend:
build:
context: ./backend
container_name: lab_backend
ports:
- "8000:8000"
volumes:
- ./backend/src:/app/src
- ./backend/uploads:/app/uploads
- ./backend/vector_store:/app/vector_store
env_file:
- ./backend/.env
deploy:
resources:
limits:
cpus: '2.0'
memory: 6G
environment:
- OLLAMA_HOST=host.docker.internal
command: uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload --app-dir /app
depends_on:
db:
condition: service_healthy
# 3. The JavaScript Frontend Service (React)
frontend:
build:
context: ./frontend # Look for a Dockerfile in the ./frontend directory
container_name: lab_frontend
ports:
# Exposes the React dev server port (5173 is the default for Vite).
# We'll access the UI at http://localhost:5173
- "5173:5173"
volumes:
- ./frontend/src:/app/src
- ./frontend/public:/app/public
- ./frontend/index.html:/app/index.html
- ./frontend/vite.config.js:/app/vite.config.js
- ./frontend/package.json:/app/package.json
- ./frontend/package-lock.json:/app/package-lock.json
- ./frontend/eslint.config.js:/app/eslint.config.js
env_file:
- ./frontend/.env
command: npm run dev -- --host
depends_on:
- backend
volumes:
postgres_data: