feat(codex-web-workstation): add Codex CLI web workstation builder

* feat(codex-web-workstation): add image builder with CI workflow

- Ubuntu 24.04 base with dev user, NodeSource 20.x, ttyd 1.7.7, code-server, @openai/codex
- 5 runtime scripts: entrypoint.sh, configure-provider.sh, healthcheck.sh, doctor.sh, smoke-test.sh
- Build parameter resolver and architecture allowlist
- GitHub Actions workflow: build-codex-web-workstation.yml (workflow_dispatch, docker/build-push-action@v6, ghcr.io)
- Image-only: no docker-compose, Caddyfile, or compose-time config

* fix(ci): use hyphenated input names (image-tag, push-latest)

* fix(health): replace curl -sf with tolerant HTTP status check

- healthcheck.sh: accept any 2xx/3xx/4xx response as proof of listening
  (code-server returns 302, ttyd returns 401 with basic auth)
- smoke-test.sh: same fix for HTTP probe tolerance
- Dockerfile: remove duplicate Runtime comment
- .env.example: remove unused USER_UID/USER_GID (not declared as ARG in Dockerfile)
This commit is contained in:
okxlin
2026-06-13 14:11:04 +08:00
committed by GitHub
parent cf41c01051
commit 904e28fa64
12 changed files with 798 additions and 0 deletions
@@ -0,0 +1,104 @@
name: Build Codex Web Workstation Image
on:
workflow_dispatch:
inputs:
image-tag:
description: "Published image tag; leave empty to use latest"
required: false
default: "latest"
platforms:
description: "Comma-separated target platforms"
required: true
default: "linux/amd64"
push-latest:
description: "Also publish latest tag"
required: true
default: false
type: boolean
concurrency:
group: build-codex-web-workstation-${{ github.ref }}
cancel-in-progress: true
env:
IMAGE_REPO: codex-web-workstation
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Normalize repository owner
id: owner
run: |
LOWER_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
echo "lower_owner=$LOWER_OWNER" >> "$GITHUB_OUTPUT"
- name: Checkout repository
uses: actions/checkout@v4
- name: Resolve build parameters
id: params
run: |
chmod +x codex-web-workstation-builder/scripts/*.sh
bash codex-web-workstation-builder/scripts/resolve-build-params.sh \
--image-repo "${IMAGE_REPO}" \
--platforms "${{ github.event.inputs.platforms || 'linux/amd64' }}" \
--image-tag "${{ github.event.inputs['image-tag'] || 'latest' }}" \
--push-latest "${{ github.event.inputs['push-latest'] == 'true' && 'true' || 'false' }}" \
--latest-tag "latest" \
--github-output "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ steps.owner.outputs.lower_owner }}/${{ steps.params.outputs.image_repo }}
tags: ${{ steps.params.outputs.tags }}
labels: |
org.opencontainers.image.title=Codex Web Workstation
org.opencontainers.image.description=Browser-accessible workstation with Codex CLI, code-server, and ttyd in a single Docker image.
org.opencontainers.image.vendor=${{ github.repository_owner }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./codex-web-workstation-builder/image
file: ./codex-web-workstation-builder/image/Dockerfile
platforms: ${{ steps.params.outputs.platforms }}
push: true
build-args: |
TTYD_VERSION=1.7.7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Emit build summary
run: |
{
echo "## Codex Web Workstation image build"
echo ""
echo "- Image: ghcr.io/${{ steps.owner.outputs.lower_owner }}/${{ steps.params.outputs.image_repo }}"
echo "- Published image tag: ${{ steps.params.outputs.image_tag }}"
echo "- Tags: ${{ steps.meta.outputs.tags }}"
echo "- Platforms: ${{ steps.params.outputs.platforms }}"
} >> "$GITHUB_STEP_SUMMARY"