Commit 34aaa06
fix: run coder container as vscode user for ide compatibility (#417)
* fix: correct database hostnames in devcontainer post-start script
Fixes devcontainer startup failure with "exit status 127" error.
Changes:
- Update pg_isready to use localhost instead of db hostname
- Update redis-cli to use localhost instead of redis hostname
- Update connection info messages to reflect localhost usage
Root Cause:
The docker-compose.yml uses `network_mode: service:db` which means
all services (devcontainer, db, redis) share the same network namespace.
In this configuration, services communicate via localhost, not via
service hostnames like 'db' or 'redis'.
Impact:
- Resolves "exit status 127" devcontainer startup errors
- Enables proper PostgreSQL and Redis health checks
- Fixes devcontainer lifecycle scripts execution
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix: make .env file optional and auto-create from example
Fixes devcontainer startup failure when .env file is missing.
Changes:
- Make env_file optional in docker-compose.yml (required: false)
- Auto-create .devcontainer/.env from .env.example in post-create script
- Ensures .env file exists before docker-compose runs
Root Cause:
Docker Compose was failing with "env file not found" error because
.env file wasn't being created in new workspace environments.
Impact:
- Resolves "env file not found" error during devcontainer startup
- Automatically configures environment for both local and Coder workspaces
- No manual .env file creation needed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix: auto-detect database hostnames for coder and devcontainer
Changes:
- Auto-detect environment using CODER_AGENT_TOKEN variable
- Use 'db'/'redis' hostnames in Coder, 'localhost' in devcontainer
- Fix VS Code server directory permissions
- Update connection info to show correct hostnames
Fixes the 'exit status 127' error and permission issues in Coder.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix: disable coder devcontainer auto-detection
Adds CODER_AGENT_DEVCONTAINERS_ENABLE=0 to agent startup to prevent
Coder from spawning nested devcontainer agent. Template already
manages all containers directly.
Fixes simpleaccounts-uae agent timeout/connection issues.
See: coder/coder#19345
* fix: run coder container as vscode user for ide compatibility
Adds user: vscode:vscode to docker_container resource to match
devcontainer.json remoteUser setting. This fixes permission errors
when VS Code/Cursor tries to create .vscode-server directories.
Fixes: mkdir permission denied errors during IDE connection
---------
Co-authored-by: Mohsin Hashmi <mhashmi@wiser.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent de34145 commit 34aaa06
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
267 | 271 | | |
268 | 272 | | |
269 | 273 | | |
| |||
0 commit comments