-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
91 lines (89 loc) · 3.41 KB
/
Copy pathdocker-compose.yml
File metadata and controls
91 lines (89 loc) · 3.41 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
# Mortred Model Server - container orchestration for BOTH deployment profiles.
#
# GPU profile (default, full CUDA/TensorRT stack):
# docker compose --profile gpu up -d
# CPU profile (no NVIDIA GPU required):
# docker compose --profile cpu up -d
# Both: MORTRED_API_TOKEN + MORTRED_GATEWAY_AUTH_TOKEN + MORTRED_METRICS_TOKEN
# must be set (`mortredctl init-trust`). weights dir mount defaults to ./weights,
# override with WEIGHTS_DIR.
#
# Two host ports: supervisor (management) 8787 + gateway (inference) 8080.
# Both bind 127.0.0.1 on the host. Autostart uses conf/packs/demo.toml
# (MORTRED_PACK), not every conf/server model. LAN/WAN TLS is Nginx on the
# host network (mortredctl init-edge, deploy/nginx). Use "8080:8080" /
# "8787:8787" only if you accept plaintext Bearer tokens on that interface —
# then MORTRED_EXPOSE=unsafe and a distinct MORTRED_METRICS_TOKEN are required.
# Do not publish model ports (9001+).
services:
mortred:
profiles: ["gpu"]
build:
context: .
target: mortred-gpu
image: mortred_model_server:gpu
container_name: mortred
environment:
MORTRED_EXPOSE: docker
MORTRED_API_TOKEN: "${MORTRED_API_TOKEN:?set MORTRED_API_TOKEN to protect the supervisor API}"
MORTRED_GATEWAY_AUTH_TOKEN: "${MORTRED_GATEWAY_AUTH_TOKEN:?set MORTRED_GATEWAY_AUTH_TOKEN to protect inference}"
MORTRED_METRICS_TOKEN: "${MORTRED_METRICS_TOKEN:?set MORTRED_METRICS_TOKEN (distinct scrape secret)}"
MORTRED_AUTOSTART: "true"
MORTRED_PACK: "/opt/mortred/conf/packs/demo.toml"
ports:
- "127.0.0.1:8787:8787"
- "127.0.0.1:8080:8080"
volumes:
- "${WEIGHTS_DIR:-./weights}:/opt/mortred/weights"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
healthcheck:
test: ["CMD", "curl", "-fs", "http://localhost:8787/api/v1/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 60s
restart: unless-stopped
mortred-cpu:
profiles: ["cpu"]
build:
context: .
target: mortred-cpu
image: mortred_model_server:cpu
container_name: mortred-cpu
environment:
MORTRED_EXPOSE: docker
MORTRED_API_TOKEN: "${MORTRED_API_TOKEN:?set MORTRED_API_TOKEN to protect the supervisor API}"
MORTRED_GATEWAY_AUTH_TOKEN: "${MORTRED_GATEWAY_AUTH_TOKEN:?set MORTRED_GATEWAY_AUTH_TOKEN to protect inference}"
MORTRED_METRICS_TOKEN: "${MORTRED_METRICS_TOKEN:?set MORTRED_METRICS_TOKEN (distinct scrape secret)}"
MORTRED_PROFILE: "cpu"
MORTRED_AUTOSTART: "true"
MORTRED_PACK: "/opt/mortred/conf/packs/demo.toml"
ports:
- "127.0.0.1:8787:8787"
- "127.0.0.1:8080:8080"
volumes:
- "${WEIGHTS_DIR:-./weights}:/opt/mortred/weights"
healthcheck:
test: ["CMD", "curl", "-fs", "http://localhost:8787/api/v1/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
restart: unless-stopped
# Linux host network only. Generate first:
# mortredctl init-edge --mode lan --out conf/local/edge
# A bridge-network Nginx cannot reach Mortred's 127.0.0.1 listeners.
mortred-edge:
profiles: ["edge"]
image: nginx:1.26-alpine
network_mode: host
volumes:
- "${MORTRED_EDGE_DIR:-./conf/local/edge}:/data/edge:ro"
command: ["nginx", "-p", "/data/edge", "-c", "nginx.conf", "-g", "daemon off;"]
restart: unless-stopped