-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
128 lines (121 loc) · 4.49 KB
/
docker-compose.yml
File metadata and controls
128 lines (121 loc) · 4.49 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
# Smallest self-host layout: API + UI + SQLite volume.
# Uncomment the postgres / redis / otel blocks for larger deployments.
services:
api:
build:
context: ..
dockerfile: deploy/docker/Dockerfile.api
environment:
ASPNETCORE_URLS: http://+:8080
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT:-Development}
Database__Provider: Sqlite
Database__Path: /data/adaptiveapi.db
Translators__Default: ${LLMTRANS_DEFAULT_TRANSLATOR:-passthrough}
Translators__DeepL__ApiKey: ${DEEPL_API_KEY:-}
Translators__DeepL__BaseUrl: ${DEEPL_BASE_URL:-https://api.deepl.com/}
Translators__Llm__ApiKey: ${LLM_TRANSLATOR_API_KEY:-}
Translators__Llm__BaseUrl: ${LLM_TRANSLATOR_BASE_URL:-https://api.openai.com/}
Translators__Llm__Model: ${LLM_TRANSLATOR_MODEL:-gpt-4o-mini}
Dev__FixedRouteToken: ${DEV_FIXED_ROUTE_TOKEN:-}
PublicBaseUrl: ${PUBLIC_BASE_URL:-http://localhost:8080}
volumes:
- adaptiveapi-data:/data
# Drop AdaptiveAPI plugin DLLs into ./plugins on the host to load them
# into the API container at startup. Each *.dll there is scanned by
# the plugin loader. See examples/sample-plugin/README.md for a
# ready-to-build reference.
- ./plugins:/app/plugins:ro
expose:
- "8080"
ports:
- "${API_PORT:-8080}:8080"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8080/healthz || exit 1"]
interval: 15s
timeout: 3s
retries: 3
start_period: 10s
ui:
build:
context: ..
dockerfile: deploy/docker/Dockerfile.ui
depends_on:
api:
condition: service_healthy
ports:
- "${UI_PORT:-8000}:80"
restart: unless-stopped
# Sample app: minimal .NET backend + Vue UI that talks to OpenAI through adaptiveapi.
# Optional — only starts when you run `docker compose --profile demo up`.
demo-api:
profiles: ["demo"]
build:
context: ..
dockerfile: deploy/docker/Dockerfile.demo-api
depends_on:
api:
condition: service_healthy
environment:
ASPNETCORE_URLS: http://+:5100
ASPNETCORE_ENVIRONMENT: Production
Demo__LlmtransBaseUrl: http://api:8080
Demo__LlmtransRouteToken: ${DEV_FIXED_ROUTE_TOKEN:-rt_dev_LOCALDEMO}
Demo__OpenAiApiKey: ${OPENAI_API_KEY:-}
Demo__Model: ${DEMO_MODEL:-gpt-4o-mini}
Demo__LlmLanguage: ${DEMO_LLM_LANGUAGE:-en}
Demo__Temperature: ${DEMO_TEMPERATURE:-0.3}
Demo__SystemPrompt: ${DEMO_SYSTEM_PROMPT:-You are a friendly assistant. Keep answers short and concrete.}
Demo__AllowedOrigins__0: http://localhost:${DEMO_UI_PORT:-8100}
Demo__IncludePayloads: ${DEMO_INCLUDE_PAYLOADS:-true}
ports:
- "${DEMO_API_PORT:-5100}:5100"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:5100/healthz || exit 1"]
interval: 15s
timeout: 3s
retries: 3
start_period: 10s
demo-ui:
profiles: ["demo"]
build:
context: ..
dockerfile: deploy/docker/Dockerfile.demo-ui
depends_on:
demo-api:
condition: service_healthy
ports:
- "${DEMO_UI_PORT:-8100}:80"
restart: unless-stopped
# Optional: Redis for translation cache, rate limits, route cache.
# Enable by uncommenting and setting `Redis__ConnectionString` on api.
# redis:
# image: redis:7-alpine
# command: ["redis-server", "--save", "60", "1", "--appendonly", "no"]
# volumes:
# - adaptiveapi-redis:/data
# restart: unless-stopped
# Optional: Postgres for production-grade persistence.
# To use: set api env Database__Provider=Postgres,
# Database__ConnectionString=Host=postgres;Database=adaptiveapi;Username=adaptiveapi;Password=${POSTGRES_PASSWORD}
# postgres:
# image: postgres:17-alpine
# environment:
# POSTGRES_DB: adaptiveapi
# POSTGRES_USER: adaptiveapi
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?postgres password required}
# volumes:
# - adaptiveapi-postgres:/var/lib/postgresql/data
# restart: unless-stopped
# Optional: OTLP collector — set api env OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
# otel-collector:
# image: otel/opentelemetry-collector-contrib:latest
# command: ["--config=/etc/otel-collector-config.yaml"]
# volumes:
# - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml:ro
# restart: unless-stopped
volumes:
adaptiveapi-data:
# adaptiveapi-redis:
# adaptiveapi-postgres: