Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
smoke:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
port: [8080, 8090]
steps:
- uses: actions/checkout@v4

Expand All @@ -37,8 +40,9 @@ jobs:
- name: Start container
run: |
docker run -d --name smoke-test \
-p 18080:8080 \
-p 1${{ matrix.port }}:${{ matrix.port }} \
-e NODE_ENV=production \
-e PORT=${{ matrix.port }} \
codex-proxy:smoke
echo "Container started"

Expand All @@ -60,14 +64,14 @@ jobs:

- name: Verify /health endpoint
run: |
RESPONSE=$(curl -sf http://localhost:18080/health)
RESPONSE=$(curl -sf http://localhost:1${{ matrix.port }}/health)
echo "Response: $RESPONSE"
echo "$RESPONSE" | jq -e '.status == "ok"'

- name: Verify /v1/models returns valid JSON
run: |
# Without auth, should return 401 or model list — either way must be valid JSON
STATUS=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:18080/v1/models)
STATUS=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:1${{ matrix.port }}/v1/models)
echo "/v1/models status: $STATUS"
# 200 (no key set) or 401 (key set) are both acceptable
if [ "$STATUS" != "200" ] && [ "$STATUS" != "401" ]; then
Expand Down
14 changes: 11 additions & 3 deletions docker-healthcheck.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/sh
# Read server port from config, fallback to 8080
PORT=$(grep -A5 '^server:' /app/config/default.yaml 2>/dev/null | grep 'port:' | head -1 | awk '{print $2}')
curl -fs "http://localhost:${PORT:-8080}/health" || exit 1
# Read server port dynamically (PORT env var -> local.yaml -> default.yaml -> 8080)
RESOLVED_PORT=${PORT}
if [ -z "$RESOLVED_PORT" ]; then
RESOLVED_PORT=$(grep -A5 '^server:' /app/data/local.yaml 2>/dev/null | grep 'port:' | head -1 | awk '{print $2}')
fi
if [ -z "$RESOLVED_PORT" ]; then
RESOLVED_PORT=$(grep -A5 '^server:' /app/config/default.yaml 2>/dev/null | grep 'port:' | head -1 | awk '{print $2}')
fi
RESOLVED_PORT=${RESOLVED_PORT:-8080}

curl -fs "http://localhost:${RESOLVED_PORT}/health" || exit 1
Loading