{
    "name": "Project Devcontainer",
    "image": "mcr.microsoft.com/devcontainers/typescript-node:24-trixie",
    "features": {
        "ghcr.io/devcontainers/features/python@sha256:fbcad6955caeecc5ad3f7886baf652e25cba5225a6c4c2287c536de2e5607511": {
            "version": "3.12",
            "installPythonDevDependencies": true
        },
        "ghcr.io/devcontainer-community/devcontainer-features/astral.sh-uv@sha256:36f95b90080248a05aba7b1b3cecf8018bb6d7222f6274f03f050b502abd4fe7": {
            "shellautocompletion": true
        },
        "ghcr.io/devcontainers-extra/features/ripgrep@sha256:0dfc0ac16f0d6aa754d006a138fd4cb4a62c245d308306edf8ad1b7a80b8fdf2": {},
        "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671": {}
    },
    // Ask the editor to forward these container ports (no Docker appPort).
    "forwardPorts": [8787, 3005, 3001, 3000],

    "portsAttributes": {
        "8787": {
            "label": "Hono Dev Server",
            "onAutoForward": "notify"
        },
        "3005": {
            "label": "Nuxt Dev Server",
            "onAutoForward": "notify"
        },
        "3001": {
            "label": "Nuxt Preview Server",
            "onAutoForward": "silent"
        },
        "3000": {
            "label": "Published dev server",
            "protocol": "http",
            "onAutoForward": "notify",
            "requireLocalPort": false
        },
        // only enable when running Caddy http proxy in the container
        // "80": {
        //     "label": "Caddy HTTP",
        //     "onAutoForward": "notify"
        // },
        // "443": {
        //     "label": "Caddy HTTPS",
        //     "onAutoForward": "notify"
        // }
    },

    "otherPortsAttributes": {
        "onAutoForward": "notify",
        "requireLocalPort": false
    },

    "mounts": [
        "source=${localEnv:HOME}/.gitconfig,target=/home/node/.gitconfig,type=bind,consistency=cached",
        // mount host user home directories for agents:
        // "source=${localEnv:HOME}/.claude,target=/home/node/.claude,type=bind,consistency=cached",
        // "source=${localEnv:HOME}/.gemini,target=/home/node/.claude,type=bind,consistency=cached",
        // "source=${localEnv:HOME}/.codex,target=/home/node/.codex,type=bind,consistency=cached"
    ],

    // Initialize optional host-side secrets before container create/start.
    "initializeCommand": "bash .devcontainer/initialize.sh",
    // After up, discover the published host binding, e.g.:
    // docker port <container-name-or-id> 3000/tcp
    "runArgs": [
        // publish container port 3000 with dynamic host port (CLI / start.sh)
        "-p",
        "127.0.0.1::3000",
        // pass the development environment file to the container
        "--env-file",
        "${localWorkspaceFolder}/.env.development"
    ],
    // --
    "postCreateCommand": "bash .devcontainer/post-create.sh",
    "postStartCommand": "bash .devcontainer/post-start.sh",
    "remoteUser": "node",
    "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
    "containerEnv": {
        "NODE_ENV": "development",
        "ANTHROPIC_API_KEY": "${localEnv:ANTHROPIC_API_KEY}",
        "SNYK_TOKEN": "${localEnv:SNYK_TOKEN}"
    }
}
