@@ -13,8 +13,9 @@ services:
1313 - OPENCODE_SERVER_PASSWORD=${OPENCODE_SERVER_PASSWORD:-}
1414 - OPENCODE_ZEN_API_KEY=${OPENCODE_ZEN_API_KEY:-}
1515 - API_KEY=${API_KEY:-}
16- - BIND_HOST=0.0.0.0
16+ - BIND_HOST=${BIND_HOST:- 0.0.0.0}
1717 - DISABLE_TOOLS=${DISABLE_TOOLS:-true}
18+ - OPENCODE_DISABLE_TOOLS=${OPENCODE_DISABLE_TOOLS:-}
1819 - OPENCODE_USE_ISOLATED_HOME=${OPENCODE_USE_ISOLATED_HOME:-false}
1920 - OPENCODE_PROXY_DEBUG=${OPENCODE_PROXY_DEBUG:-false}
2021 - OPENCODE_PROXY_PROMPT_MODE=${OPENCODE_PROXY_PROMPT_MODE:-standard}
@@ -23,18 +24,36 @@ services:
2324 - OPENCODE_PROXY_CLEANUP_INTERVAL_MS=${OPENCODE_PROXY_CLEANUP_INTERVAL_MS:-43200000}
2425 - OPENCODE_PROXY_CLEANUP_MAX_AGE_MS=${OPENCODE_PROXY_CLEANUP_MAX_AGE_MS:-86400000}
2526 - OPENCODE_PROXY_REQUEST_TIMEOUT_MS=${OPENCODE_PROXY_REQUEST_TIMEOUT_MS:-180000}
27+ - OPENCODE_PROXY_RETRY_MAX_RETRIES=${OPENCODE_PROXY_RETRY_MAX_RETRIES:-3}
2628 - OPENCODE_PROXY_PORT=${OPENCODE_PROXY_PORT:-10000}
2729 - OPENCODE_SERVER_PORT=${OPENCODE_SERVER_PORT:-10001}
2830 volumes :
2931 - opencode-data:/home/node/.local/share/opencode
3032 - opencode-config:/home/node/.config/opencode
3133 restart : unless-stopped
34+ # Guard small (1GB) hosts: cap memory/CPU so one slow request cannot wedge
35+ # the whole machine (see docs/host-deployments.md §9). Raw `docker run`
36+ # hosts should pass the equivalents: --memory=768m --memory-reservation=256m
37+ # --cpus=1.5 --pids-limit=256.
38+ mem_limit : 768m
39+ mem_reservation : 256m
40+ cpus : 1.5
41+ pids_limit : 256
42+ logging :
43+ driver : json-file
44+ options :
45+ max-size : " 10m"
46+ max-file : " 3"
3247 healthcheck :
48+ # Shallow on purpose: /health needs no auth; /health/details would 401
49+ # when HEALTH_DETAILS_REQUIRE_AUTH=true and has no credentials here.
3350 test : ["CMD", "curl", "-f", "http://localhost:${OPENCODE_PROXY_PORT:-10000}/health"]
3451 interval : 30s
3552 timeout : 10s
3653 retries : 3
37- start_period : 60s
54+ # Must cover entrypoint backend wait (~180s on cold small hosts) plus
55+ # probe intervals; 120s flapped unhealthy during normal warmup.
56+ start_period : 200s
3857
3958volumes :
4059 opencode-data :
0 commit comments