Repository navigation
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
136 lines (130 loc) · 4.32 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
136 lines (130 loc) · 4.32 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Docker Compose for backend services only (recommended for Electron development)
services:
# Backend Only - CORE FastAPI Application
core-backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: core-backend
ports:
- "127.0.0.1:8001:8001"
environment:
- PYTHONPATH=/app
- CORE_ENV=development
# Dev API key — matches the UI's default (AppConfigService) so the frontend authenticates locally.
- CORE_API_KEY=core_dev_key
- DATABASE_URL=postgresql://core_user:core_password@postgres:5432/core_db
- REDIS_URL=redis://redis:6379
- OLLAMA_BASE_URL=http://ollama:11434
# LM Studio (optional local provider). Start LM Studio's server on the host
# (Developer tab -> Start Server, :1234) and set LMSTUDIO_MODELS to the model
# id(s) you have loaded. host.docker.internal reaches the host from the container.
# See docs/deployment/local-llm-providers.md.
- LMSTUDIO_BASE_URL=${LMSTUDIO_BASE_URL:-http://host.docker.internal:1234/v1}
- LMSTUDIO_MODELS=${LMSTUDIO_MODELS:-}
# CORE uses LM Studio as its local provider by default. Override in the root
# .env (CORE_LOCAL_PROVIDER=ollama) to use the optional Ollama container.
- CORE_LOCAL_PROVIDER=${CORE_LOCAL_PROVIDER:-lmstudio}
- CORE_DEFAULT_MODEL=${CORE_DEFAULT_MODEL:-}
- OBSIDIAN_VAULT_PATH=/vault
- OBSIDIAN_API_KEY=${OBSIDIAN_API_KEY}
command: >
uv run uvicorn app.main:app
--host 0.0.0.0 --port 8001 --reload --app-dir /app
volumes:
- ./backend:/app
- backend-data:/app/data
# Local dev vault (original hardcoded host path was for a different machine).
# Point this at your real Obsidian vault if/when you want live notes.
- "./vault:/vault"
extra_hosts:
# Lets the container reach host services like LM Studio at host.docker.internal.
- "host.docker.internal:host-gateway"
networks:
- core-network
depends_on:
- postgres
- redis
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 30s
timeout: 10s
retries: 3
# Database - PostgreSQL
postgres:
image: pgvector/pgvector:pg15
container_name: core-postgres
environment:
- POSTGRES_DB=core_db
- POSTGRES_USER=core_user
- POSTGRES_PASSWORD=core_password
volumes:
- postgres-data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "127.0.0.1:5432:5432"
networks:
- core-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U core_user -d core_db"]
interval: 30s
timeout: 10s
retries: 3
# Redis - For caching and session management
redis:
image: redis:7-alpine
container_name: core-redis
ports:
- "127.0.0.1:6379:6379"
volumes:
- redis-data:/data
networks:
- core-network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
# Local LLM Inference - Ollama (OPTIONAL — CORE uses LM Studio by default).
# Not started by a plain `up`; enable explicitly with:
# docker compose --profile ollama up -d
ollama:
image: ollama/ollama:latest
container_name: core-ollama
profiles: ["ollama"]
ports:
- "127.0.0.1:11434:11434"
volumes:
# Machine-agnostic by default: a named Docker volume (no host path required).
# To reuse host-installed models instead, set OLLAMA_MODELS_DIR in the root .env
# to your models directory, e.g.:
# OLLAMA_MODELS_DIR=C:/Users/<you>/.ollama (Windows)
# OLLAMA_MODELS_DIR=${HOME}/.ollama (macOS/Linux)
- ${OLLAMA_MODELS_DIR:-ollama-data}:/root/.ollama
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
networks:
- core-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"]
interval: 30s
timeout: 10s
retries: 5
volumes:
backend-data:
postgres-data:
redis-data:
ollama-data:
networks:
core-network:
driver: bridge