-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
49 lines (47 loc) · 2.04 KB
/
Copy pathdocker-compose.yml
File metadata and controls
49 lines (47 loc) · 2.04 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
# Milon — schlankes Zwei-Service-Setup für Docker Desktop.
# server = FastAPI (:8000), APScheduler-Jobs, SQLite unter ./data
# client = Next.js (:3000), proxied /api/* serverseitig an den Server (kein CORS nötig)
#
# Start: docker compose up -d --build
# Aufruf: http://localhost:3000 (im Heim-WLAN vom Handy: http://<PC-IP>:3000)
# Logs: docker compose logs -f
# Stop: docker compose down
services:
server:
build: ./server
restart: unless-stopped
volumes:
# App-DB, incoming/ und progress/ liegen persistent auf dem Host (nicht im Image)
- ./data:/app/data
# Secrets: pydantic-settings liest server/.env; die Settings-Seite schreibt hierher zurück
- ./server/.env:/app/server/.env
# KEIN Host-Port: der Server ist NUR im internen Compose-Netz erreichbar (Servicename "server").
# Port 8000 bleibt damit auf dem Host frei für andere Projekte. Der Client spricht ihn intern an.
# expose dient nur der Doku (kein Host-Mapping):
expose:
- "8000"
# Optionales RAM-Limit (bei OOM während großer HC-Importe erhöhen/entfernen):
# mem_limit: 768m
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0) if urllib.request.urlopen('http://127.0.0.1:8000/health').status==200 else sys.exit(1)"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
client:
build:
context: ./client
args:
# Next-Rewrite-Ziel: wird zur BUILD-Zeit in die routes-manifest.json eingebacken
# (Runtime-Env würde nicht greifen). Der Server ist im Compose-Netz per Servicename da.
API_PROXY_TARGET: http://server:8000
restart: unless-stopped
# Nur das Frontend ist von außen erreichbar — standardmäßig auf Port 80, damit die URL
# ohne :3000 auskommt (http://milon.local). Über WEB_PORT in .env überschreibbar.
# Port 3000 bleibt auf dem Host frei für andere Projekte.
ports:
- "${WEB_PORT:-80}:3000"
depends_on:
server:
condition: service_started
# mem_limit: 256m