chore: Add Codespaces devcontainer variant for cloud agent sessions (no-changelog) (#35855)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Declan Carroll 2026-08-07 13:52:24 +01:00 committed by GitHub
parent 76a0105a96
commit ad6e10943d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,27 @@
ARG NODE_VERSION=24
# Debian, not Alpine: Playwright browsers and the agent CLIs need glibc
FROM node:${NODE_VERSION}-bookworm
ARG PLAYWRIGHT_VERSION=1.60.0
RUN apt-get update && apt-get install -y --no-install-recommends \
tmux sudo less jq ripgrep postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Chromium system libs baked into the image; browser binaries install per-user in onCreate
RUN npx -y playwright@${PLAYWRIGHT_VERSION} install-deps chromium
# Agent harnesses. Self-update is off: the image is the update mechanism
ENV DISABLE_AUTOUPDATER=1
RUN npm install -g @anthropic-ai/claude-code opencode-ai
RUN echo node ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/node && chmod 0440 /etc/sudoers.d/node
RUN mkdir -p /workspaces && chown node:node /workspaces
RUN corepack enable
ENV PNPM_HOME=/home/node/.local/share/pnpm
ENV PATH=$PNPM_HOME/bin:$PATH
USER node
RUN mkdir -p $PNPM_HOME ~/.pnpm-store && pnpm config set store-dir ~/.pnpm-store --global

View File

@ -0,0 +1,25 @@
{
"name": "n8n (Codespaces agent sessions)",
"dockerComposeFile": "docker-compose.yml",
"service": "n8n",
"workspaceFolder": "/workspaces",
"hostRequirements": {
"cpus": 8,
"memory": "32gb",
"storage": "64gb"
},
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"forwardPorts": [8080, 5678],
// Runs in prebuilds, so a fresh codespace starts with deps installed and the build warm
"onCreateCommand": "corepack install && pnpm install && (pnpm build > /tmp/build.log 2>&1 || tail -n 50 /tmp/build.log) && pnpm --filter=n8n-playwright exec playwright install chromium",
"secrets": {
"ANTHROPIC_API_KEY": {
"description": "Anthropic API key for Claude Code / OpenCode sessions"
},
"CLAUDE_CODE_OAUTH_TOKEN": {
"description": "Alternative to an API key: token from `claude setup-token` (Max subscription)"
}
}
}

View File

@ -0,0 +1,26 @@
volumes:
postgres-data:
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=n8n
- POSTGRES_PASSWORD=password
n8n:
build:
context: .
dockerfile: Dockerfile
volumes:
- ../..:/workspaces:cached
command: sleep infinity
depends_on:
- postgres
environment:
DB_POSTGRESDB_HOST: postgres
DB_TYPE: postgresdb
DB_POSTGRESDB_PASSWORD: password