-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
104 lines (99 loc) · 2.72 KB
/
docker-compose.yml
File metadata and controls
104 lines (99 loc) · 2.72 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
version: "3.8"
services:
postgres:
image: postgres:16.8-alpine
container_name: focus-postgres
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
- focus-net
environment:
- POSTGRES_DB=${POSTGRES_DB:-focus}
- POSTGRES_USER=${POSTGRES_USER:-focus}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-focus-change-me}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- focus-postgres-data:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:-focus} -d ${POSTGRES_DB:-focus}",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
backend:
image: ghcr.nju.edu.cn/${GITHUB_USERNAME:-freekatz}/focus-backend:latest
container_name: focus-backend
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
focus-net:
aliases:
- backend
environment:
- SECRET_KEY=${SECRET_KEY:-change-me-in-production}
- DEFAULT_PASSWORD=${DEFAULT_PASSWORD:-focus123}
- POSTGRES_DB=${POSTGRES_DB:-focus}
- POSTGRES_USER=${POSTGRES_USER:-focus}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-focus-change-me}
- DATABASE_URL=${DATABASE_URL:-postgresql+asyncpg://focus:focus-change-me@postgres:5432/focus}
- FRONTEND_URL=${FRONTEND_URL:-http://localhost}
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost}
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-localhost,127.0.0.1}
- AI_PROVIDER=${AI_PROVIDER:-openai}
- AI_API_KEY=${AI_API_KEY:-}
- AI_MODEL=${AI_MODEL:-gpt-4o-mini}
- AI_BASE_URL=${AI_BASE_URL:-}
- ZOTERO_LIBRARY_ID=${ZOTERO_LIBRARY_ID:-}
- ZOTERO_API_KEY=${ZOTERO_API_KEY:-}
volumes:
- focus-data:/app/data
- focus-logs:/app/logs
ports:
- "8000:8000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
depends_on:
postgres:
condition: service_healthy
frontend:
image: ghcr.nju.edu.cn/${GITHUB_USERNAME:-freekatz}/focus-frontend:latest
container_name: focus-frontend
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
- focus-net
ports:
- "8080:80"
depends_on:
backend:
condition: service_healthy
networks:
focus-net:
name: focus-net
volumes:
focus-data:
name: focus-data
focus-logs:
name: focus-logs
focus-postgres-data:
name: focus-postgres-data