Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (49 loc) · 1.55 KB
/
Copy pathdocker-compose.yml
File metadata and controls
57 lines (49 loc) · 1.55 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
# docker-compose.yml
#
# Local development compose file for Sentinel AI.
#
# Usage:
# docker compose up --build # first run (builds image)
# docker compose up -d # detached
# docker compose logs -f # follow logs
# docker compose down # stop
# docker compose down -v # stop + delete volume
#
# Requirements:
# - Copy .env.example to .env and fill in your values before running.
# - OPENROUTER_API_KEY is required.
# - JWT_SECRET must be a long random string (32+ chars).
#
# Data persistence:
# The SQLite database is stored in the 'db_data' named volume.
# It survives `docker compose down` but is removed by `docker compose down -v`.
version: "3.9"
services:
api:
build: .
container_name: terminal-ai-assistant
restart: unless-stopped
ports:
- "8000:8000"
# Load secrets and configuration from .env
env_file:
- .env
# Override DATABASE_URL to point to the persistent volume
environment:
DATABASE_URL: "sqlite:////data/storage/assistant.db"
volumes:
# Persist the SQLite database across restarts
- db_data:/data
# Optional: mount backups to host for easy access
- ./backups:/app/backups
# docker-compose healthcheck mirrors the Dockerfile HEALTHCHECK
healthcheck:
test: ["CMD", "python", "-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8000/api/v1/health')"]
interval: 30s
timeout: 5s
start_period: 15s
retries: 3
volumes:
db_data:
driver: local