Skip to content

Deployment

GodeX is designed for zero-dependency deployment: a single static binary that exposes the OpenAI-compatible Responses API gateway. Three distribution channels are supported -- a multi-stage Docker image, native compiled binaries for six platform targets, and an npm package that automatically selects the correct platform binary on install. The build system uses Bun's --compile flag to produce self-contained executables, and the Docker image uses a two-stage build to keep the runtime layer minimal.

At a Glance

AspectDetail
RuntimeStandalone binary (Bun compile)
DockerMulti-stage: oven/bun build + debian:bookworm-slim runtime
Platformsdarwin-arm64, darwin-x64, linux-x64, linux-arm64, win32-x64, win32-arm64
Default portGODEX_PORT=5678
Config path/etc/godex/godex.yaml (Docker)
Data volume/data for sessions and trace

Docker Deployment

The Dockerfile at Dockerfile:1-53 uses a two-stage build:

Build Stage

StepDescription
Base imageoven/bun:1.3.14
Dependency installbun install --frozen-lockfile --ignore-scripts
Version injectionsed replaces version in package.json via ARG VERSION
Compilationbun build --compile with target derived from TARGETARCH
DefineGODEX_BUILD_ENV="prod" baked into binary

The TARGETARCH build argument is mapped to a Bun compile target at Dockerfile:22-28: amd64 -> x64, arm64 -> arm64.

Runtime Stage

AspectValue
Base imagedebian:bookworm-slim
Binary location/usr/local/bin/godex
Data volume/data (sessions, trace)
Config volume/etc/godex
Default port5678 (env GODEX_PORT)
Entry pointgodex serve --config /etc/godex/godex.yaml

Docker Usage

bash
# Build
docker build --build-arg VERSION=1.0.0 -t godex .

# Run
docker run -d \
  -p 5678:5678 \
  -v /path/to/godex.yaml:/etc/godex/godex.yaml \
  -v godex-data:/data \
  godex

Native Binary Compilation

The compile script at scripts/compile.ts:1-107 supports three modes:

ModeCommandTargets
Current platformbun run compileMatches process.platform + process.arch
All platformsbun run compile --allAll six platforms
Specific targetbun run compile --target=darwin-arm64One platform

Platform Matrix

Defined at scripts/compile.ts:11-42:

Platformnpm PackageBun Target
macOS ARM64@ahoo-wang/godex-darwin-arm64bun-darwin-arm64
macOS x64@ahoo-wang/godex-darwin-x64bun-darwin-x64
Linux x64@ahoo-wang/godex-linux-x64bun-linux-x64
Linux ARM64@ahoo-wang/godex-linux-arm64bun-linux-arm64
Windows x64@ahoo-wang/godex-win32-x64bun-windows-x64
Windows ARM64@ahoo-wang/godex-win32-arm64bun-windows-arm64

All builds inject GODEX_BUILD_ENV="prod" via --define at line 83.

npm Package Distribution

The package.json at package.json:1-75 declares platform-specific binaries as optionalDependencies at lines 49-55:

json
"optionalDependencies": {
  "@ahoo-wang/godex-darwin-arm64": "0.0.2",
  "@ahoo-wang/godex-darwin-x64": "0.0.2",
  "@ahoo-wang/godex-linux-x64": "0.0.2",
  "@ahoo-wang/godex-linux-arm64": "0.0.2",
  "@ahoo-wang/godex-win32-x64": "0.0.2",
  "@ahoo-wang/godex-win32-arm64": "0.0.2"
}

The postinstall script at line 45 runs scripts/install.cjs to locate and link the correct binary.

Environment Variables

EnvVars at src/config/env.ts:15-30 resolves the runtime environment from the compile-time GODEX_BUILD_ENV define:

VariablePurposeValues
GODEX_BUILD_ENVCompile-time env (baked into binary)prod, dev (default)
GODEX_PORTDefault server port (Docker)Default: 5678

The Env enum at src/config/env.ts:2-5 exposes EnvVars.isDev and EnvVars.isProd for conditional behaviour throughout the codebase.

CI Pipeline

The ci script at package.json:53 runs the full validation chain:

bash
bun run typecheck && biome ci src && bun run test && bun run test:e2e
StepCommandPurpose
Type checktsc --noEmitTypeScript correctness
Lintbiome ci srcCode style enforcement
Unit testsbun testAll tests excluding E2E
E2E testsbun test src/e2eEnd-to-end integration

The check script at line 52 is a pre-push gate: typecheck + lint + test.

E2E Test Targets

CommandProviderLive Flag
test:zhipuZhipu (智谱)ZHIPU_LIVE_TESTS=1
test:deepseekDeepSeekDEEPSEEK_LIVE_TESTS=1
test:minimaxMiniMaxMINIMAX_LIVE_TESTS=1
test:xiaomiXiaomi MiMoXIAOMI_LIVE_TESTS=1

Cross-References

References