-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (91 loc) · 2.29 KB
/
docker-compose.yml
File metadata and controls
97 lines (91 loc) · 2.29 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
version: '3.8'
services:
# Frontend - React application
frontend:
image: node:18-alpine
container_name: obsidian-frontend
working_dir: /app
volumes:
- ./frontend:/app
- /app/node_modules
ports:
- "5173:5173"
environment:
- VITE_API_URL=http://localhost:8000
- VITE_WS_URL=ws://localhost:8000
command: sh -c "npm install && npm run dev"
depends_on:
- backend
networks:
- obsidian-network
# Backend - FastAPI application
backend:
image: python:3.10-slim
container_name: obsidian-backend
working_dir: /app
volumes:
- ./backend:/app
- ./:/app/project
- ./uploads:/app/uploads
- ./logs:/app/logs
ports:
- "8000:8000"
environment:
- PYTHONUNBUFFERED=1
- CUDA_VISIBLE_DEVICES=-1
- HOST=0.0.0.0
- PORT=8000
- DEBUG=true
- MODEL_PATH=/app/project/checkpoints/pointnet_p1_expanded/best_model.pt
- DEVICE=cpu
- ENVIRONMENT=production
# Production: Use Gunicorn with 4 workers (development: use uvicorn with reload)
command: sh -c "pip install -r requirements.txt && gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000"
depends_on:
- db
networks:
- obsidian-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
# Database - PostgreSQL
db:
image: postgres:15-alpine
container_name: obsidian-db
environment:
- POSTGRES_DB=obsidian
- POSTGRES_USER=obsidian
- POSTGRES_PASSWORD=obsidian_dev
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- obsidian-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U obsidian"]
interval: 10s
timeout: 5s
retries: 5
# Optional: pgAdmin for database management
pgadmin:
image: dpage/pgadmin4:latest
container_name: obsidian-pgadmin
environment:
- PGADMIN_DEFAULT_EMAIL=admin@obsidian.local
- PGADMIN_DEFAULT_PASSWORD=admin
ports:
- "5050:80"
depends_on:
- db
networks:
- obsidian-network
volumes:
postgres_data:
driver: local
networks:
obsidian-network:
driver: bridge