assessment-model/.devcontainer/docker-compose.yml
Jun-te Kim acbb2c4054 fix(devcontainer): publish 8400 in compose so the CLI path exposes it
devcontainer.json's forwardPorts is a VS Code feature; the devcontainer CLI
(which devcontainer.sh drives) doesn't implement it. Compose only published
3000, so a container started via `./devcontainer.sh up|rebuild` left the
impeccable live helper on 8400 unreachable from the host — and the failure is
silent: the page loads, the injected script 404s, the element picker just never
appears.

Publish 8400:8400 explicitly. The mapping is fixed rather than dynamic because
the injected script hard-codes http://localhost:8400, which also means only one
container at a time can run live mode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 17:43:55 +00:00

61 lines
2.2 KiB
YAML

services:
frontend:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
# Match host UID/GID so files written in the container aren't root-owned.
args:
USER_UID: ${UID:-1000}
USER_GID: ${GID:-1000}
command: sleep infinity
ports:
# Host port left unspecified so Docker assigns a free one — lets multiple
# worktrees of this repo run at once without colliding. VS Code's
# forwardPorts (below) forwards container :3000 to your machine.
- "3000"
# impeccable live mode's helper (serves /live.js + SSE to the page).
# Published here, not just in devcontainer.json's forwardPorts, because
# `devcontainer.sh` drives the devcontainer CLI, which does NOT implement
# forwardPorts — that's a VS Code-only feature. Without this line, a
# CLI-started container leaves 8400 unreachable and the element picker
# silently never loads.
#
# The mapping is fixed (not dynamic like 3000) because the script injected
# into the page hard-codes http://localhost:8400. That means only one
# container at a time can run live mode; a second one will fail to bind
# 8400. That's inherent to live mode, not a choice we're making here.
- "8400:8400"
volumes:
- ..:/workspaces/assessment-model
- ~/.gitconfig:/home/vscode/.gitconfig
# GitHub CLI auth from host (created by `gh auth login`). Used by the
# postCreate skill installer to clone private Hestia-Homes repos.
- ~/.config/gh:/home/vscode/.config/gh:ro
environment:
# Host SSH agent — for `git push` etc. inside the container.
- SSH_AUTH_SOCK=${SSH_AUTH_SOCK:-}
# Fallback HTTPS auth if ~/.config/gh isn't present on the host.
- GITHUB_TOKEN=${GITHUB_TOKEN:-}
networks:
- frontend-net
- shared-dev
pgadmin:
image: dpage/pgadmin4
hostname: pgadmin
ports:
# Dynamic host port (see frontend above). VS Code auto-detects and
# forwards the listening container port when the container comes up.
- "80"
env_file:
- ../.db-env
restart: unless-stopped
networks:
- frontend-net
networks:
frontend-net:
driver: bridge
shared-dev:
external: true
name: shared-dev