name: codex-http-gateway services: gateway: build: context: . target: gateway restart: unless-stopped init: true read_only: true cap_drop: [ALL] security_opt: ["no-new-privileges:true"] pids_limit: 64 mem_limit: 128m ports: - "127.0.0.1:${GATEWAY_PORT:-18080}:8080" networks: [gateway-ingress] volumes: - type: bind source: ${GATEWAY_KEYS_FILE:-/opt/codex-http-gateway/keys.sha256} target: /run/secrets/gateway-keys.sha256 read_only: true bind: create_host_path: false - type: bind source: ${GATEWAY_RUN_DIR:-/opt/codex-http-gateway/run} target: /run/codex-gateway read_only: true bind: create_host_path: false worker: build: context: . target: worker restart: unless-stopped init: true read_only: true cap_drop: [ALL] security_opt: ["no-new-privileges:true"] pids_limit: 128 mem_limit: 1g tmpfs: - /tmp:rw,nosuid,nodev,noexec,mode=1777,size=64m environment: CODEX_MODEL: ${CODEX_MODEL:-} networks: [worker-egress] volumes: - type: bind source: ${GATEWAY_RUN_DIR:-/opt/codex-http-gateway/run} target: /run/codex-gateway bind: create_host_path: false - type: bind source: ${CODEX_AUTH_DIR:-/opt/codex-http-gateway/codex-home} target: /var/lib/codex bind: create_host_path: false networks: gateway-ingress: worker-egress: