Skip to content

Commit 1266e7d

Browse files
committed
Fixed clauder as default volume path
1 parent 19e5f26 commit 1266e7d

4 files changed

Lines changed: 177 additions & 28 deletions

File tree

Dockerfile

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ USER root
1010
# ============================================================================
1111
# SYSTEM DEPENDENCIES
1212
# Install gosu, Node.js 20, Python/uv, and essential tools
13-
# Cache bust: 2026-01-29-v4
13+
# Cache bust: 2026-01-29-v5
1414
# ============================================================================
1515

1616
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
@@ -36,47 +36,49 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
3636

3737
# ============================================================================
3838
# PERSISTENCE CONFIGURATION
39-
# BACKWARD COMPATIBLE: Defaults to /home/coder for existing volumes
39+
# Default to /home/clauder for new deployments
4040
# ============================================================================
4141

42-
ENV HOME=/home/coder
43-
ENV USER=coder
42+
ENV HOME=/home/clauder
43+
ENV USER=clauder
4444

4545
# XDG Base Directory Specification
46-
ENV XDG_DATA_HOME=/home/coder/.local/share
47-
ENV XDG_CONFIG_HOME=/home/coder/.config
48-
ENV XDG_CACHE_HOME=/home/coder/.cache
49-
ENV XDG_STATE_HOME=/home/coder/.local/state
46+
ENV XDG_DATA_HOME=/home/clauder/.local/share
47+
ENV XDG_CONFIG_HOME=/home/clauder/.config
48+
ENV XDG_CACHE_HOME=/home/clauder/.cache
49+
ENV XDG_STATE_HOME=/home/clauder/.local/state
5050

5151
# PATH: Volume paths FIRST (user installs), image paths LAST (fallbacks)
52-
ENV PATH="/home/coder/.local/bin:/home/coder/.local/node/bin:/home/coder/.claude/local:/home/coder/node_modules/.bin:/usr/local/bin:/usr/bin:/usr/lib/code-server/lib/vscode/bin/remote-cli:${PATH}"
52+
ENV PATH="/home/clauder/.local/bin:/home/clauder/.local/node/bin:/home/clauder/.claude/local:/home/clauder/node_modules/.bin:/usr/local/bin:/usr/bin:/usr/lib/code-server/lib/vscode/bin/remote-cli:${PATH}"
5353

5454
# Custom startup scripts directory
55-
ENV ENTRYPOINTD=/home/coder/entrypoint.d
55+
ENV ENTRYPOINTD=/home/clauder/entrypoint.d
5656

5757
# ============================================================================
5858
# USER SETUP
59-
# The base image already has coder user with UID 1000
59+
# Create clauder user (UID 1000 to match base image's coder user)
6060
# ============================================================================
6161

62-
# Ensure coder user exists with correct UID/GID
63-
RUN id -u coder &>/dev/null || useradd -m -s /bin/bash -u 1000 -g 1000 coder 2>/dev/null || true
62+
RUN groupadd -g 1000 clauder 2>/dev/null || true \
63+
&& useradd -m -s /bin/bash -u 1000 -g 1000 clauder 2>/dev/null || true \
64+
&& usermod -l clauder coder 2>/dev/null || true \
65+
&& groupmod -n clauder coder 2>/dev/null || true
6466

6567
# ============================================================================
6668
# DIRECTORY SETUP
6769
# ============================================================================
6870

6971
RUN mkdir -p \
70-
/home/coder/.local/share \
71-
/home/coder/.config \
72-
/home/coder/.cache \
73-
/home/coder/.local/state \
74-
/home/coder/.local/bin \
75-
/home/coder/.local/node \
76-
/home/coder/.claude \
77-
/home/coder/entrypoint.d \
78-
/home/coder/workspace \
79-
&& chown -R 1000:1000 /home/coder
72+
/home/clauder/.local/share \
73+
/home/clauder/.config \
74+
/home/clauder/.cache \
75+
/home/clauder/.local/state \
76+
/home/clauder/.local/bin \
77+
/home/clauder/.local/node \
78+
/home/clauder/.claude \
79+
/home/clauder/entrypoint.d \
80+
/home/clauder/workspace \
81+
&& chown -R 1000:1000 /home/clauder
8082

8183
# Copy our custom entrypoint (replaces base image's entrypoint)
8284
COPY railway-entrypoint.sh /usr/bin/railway-entrypoint.sh
@@ -100,9 +102,10 @@ RUN curl -fsSL https://claude.ai/install.sh | bash \
100102
# Stay as root - entrypoint handles user switching based on RUN_AS_USER
101103
# ============================================================================
102104

103-
WORKDIR /home/coder/workspace
105+
WORKDIR /home/clauder/workspace
104106
EXPOSE 8080
105107

106108
# Use our entrypoint which calls code-server directly
107109
ENTRYPOINT ["/usr/bin/railway-entrypoint.sh"]
108110

111+

RAILWAY_TEMPLATE_GUIDE.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Railway Template Setup Guide
2+
3+
Step-by-step guide to configure the Claude Code Server Railway template.
4+
5+
---
6+
7+
## Template Metadata
8+
9+
| Field | Value |
10+
|-------|-------|
11+
| **Name** | Claude Code Server |
12+
| **Description** | Claude Code in Browser – Full VS Code with AI coding assistants |
13+
| **Repository** | `sphinxcode/claude-code-server` |
14+
15+
---
16+
17+
## Step 1: Create Template
18+
19+
1. Go to [Railway Templates](https://railway.com/new/template)
20+
2. Select your GitHub repository: `sphinxcode/claude-code-server`
21+
3. Configure the template metadata as shown above
22+
23+
---
24+
25+
## Step 2: Configure Variables
26+
27+
### Required Variables
28+
29+
| Variable | Type | Description |
30+
|----------|------|-------------|
31+
| `PASSWORD` | **Secret** | Login password for code-server |
32+
| `CLAUDER_HOME` | **Path** | Volume mount path — use `/home/coder` for existing deployments |
33+
34+
> ⚠️ **CRITICAL**: `CLAUDER_HOME` MUST match your volume mount path!
35+
36+
### Optional User Variables
37+
38+
| Variable | Default | Description |
39+
|----------|---------|-------------|
40+
| `CLAUDER_UID` | `1000` | User ID |
41+
| `CLAUDER_GID` | `1000` | Group ID |
42+
| `RUN_AS_USER` | `clauder` | Set to `root` if you need root access |
43+
44+
### Pre-Install AI CLIs (default: 0)
45+
46+
| Variable | Description |
47+
|----------|-------------|
48+
| `INSTALL_OPENCODE` | Install OpenCode |
49+
| `INSTALL_GEMINI` | Install Gemini CLI |
50+
| `INSTALL_KILOCODE` | Install KiloCode CLI |
51+
| `INSTALL_CONTINUE` | Install Continue CLI |
52+
| `INSTALL_CODEX` | Install Codex CLI |
53+
54+
### Pre-Install Dev Frameworks (default: 0)
55+
56+
| Variable | Description |
57+
|----------|-------------|
58+
| `INSTALL_BMAD` | Install BMAD Method |
59+
| `INSTALL_OPENSPEC` | Install OpenSpec |
60+
| `INSTALL_SPECKIT` | Install Spec-Kit |
61+
62+
---
63+
64+
## Step 3: Volume Configuration (REQUIRED)
65+
66+
> ⚠️ **CRITICAL**: Without a volume, ALL data is lost on every redeploy!
67+
68+
| Setting | Value |
69+
|---------|-------|
70+
| **Mount Path** | `/home/clauder` |
71+
| **Size** | 5GB+ recommended |
72+
| **Purpose** | Persists extensions, Claude auth, configs |
73+
74+
**Important**: Set `CLAUDER_HOME` to match your volume mount path!
75+
76+
---
77+
78+
## Step 4: Region Selection
79+
80+
> 📍 **CRITICAL**: Select **US West** region for optimal performance.
81+
82+
Railway region options:
83+
-`us-west1` (recommended)
84+
- `us-east4`
85+
- `europe-west4`
86+
- `asia-southeast1`
87+
88+
---
89+
90+
## Step 5: Deploy Settings
91+
92+
These are pre-configured in `railway.toml`:
93+
94+
| Setting | Value |
95+
|---------|-------|
96+
| Health Check Path | `/healthz` |
97+
| Health Check Timeout | 300s |
98+
| Restart Policy | On Failure |
99+
| Max Retries | 10 |
100+
101+
---
102+
103+
## Step 6: Publish Template
104+
105+
1. Test the deployment with your own Railway account
106+
2. Verify Claude Code authentication works
107+
3. Confirm volume persistence across redeploys
108+
4. Publish the template
109+
110+
---
111+
112+
## Marketing Copy
113+
114+
### Template Title
115+
**Claude Code Server**
116+
117+
### Template Tagline
118+
**Claude Code in Browser – YOLO Mode Enabled 🚀**
119+
120+
### Template Description
121+
122+
> **Full VS Code + Claude Code in your browser. YOLO mode ready.**
123+
>
124+
> Skip the approval prompts. Claude runs with `--dangerously-skip-permissions` out of the box—just type `claude-auto` and let it cook.
125+
>
126+
> **Why developers love it:**
127+
> - 🔥 **YOLO Mode** – No permission prompts, pure flow state
128+
> -**Instant Setup** – Deploy in 60 seconds
129+
> - 💾 **Persistent** – Extensions & auth survive redeploys
130+
> - 🛡️ **Non-root** – Runs as `clauder` user for security
131+
> - 🧠 **AI-Ready** – Optional: Gemini, OpenCode, Continue, Codex
132+
>
133+
> Perfect for vibe coding, weekend hacks, and shipping fast.
134+
135+
---
136+
137+
## Reference: Original Template Comparison
138+
139+
| Old (code-server) | New (Claude Code Server) |
140+
|-------------------|--------------------------|
141+
| Generic VS Code | Claude Code + AI CLIs |
142+
| `coder` user | `clauder` user |
143+
| No AI tools | 5 optional AI CLIs |
144+
| No frameworks | BMAD, OpenSpec, Spec-Kit |
145+
| Basic docs | Auth + region guidance |

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**Browser-based VSCode with Claude Code & Node.js**
44

5-
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/TEMPLATE_ID)
5+
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/pHwM6f?referralCode=1uw5HI&utm_medium=integration&utm_source=template&utm_campaign=generic)
66

77
Cloud IDE with persistent extensions, settings, and tools. Runs as non-root user.
88

@@ -41,6 +41,7 @@ npm --version
4141
| `CLAUDER_HOME` | **Yes** | `/home/clauder` | Volume mount path (REQUIRED) |
4242
| `CLAUDER_UID` | No | `1000` | User ID |
4343
| `CLAUDER_GID` | No | `1000` | Group ID |
44+
| `RUN_AS_USER` | No | `clauder` | Set to `root` for root access |
4445

4546
---
4647

railway-entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ echo ""
1515
# CONFIGURABLE PATHS AND USER
1616
# ============================================================================
1717

18-
CLAUDER_HOME="${CLAUDER_HOME:-/home/coder}"
18+
CLAUDER_HOME="${CLAUDER_HOME:-/home/clauder}"
1919
CLAUDER_UID="${CLAUDER_UID:-1000}"
2020
CLAUDER_GID="${CLAUDER_GID:-1000}"
2121

22-
# RUN_AS_USER: Set to "coder" to run as non-root, or "root" (default) to stay as root
23-
RUN_AS_USER="${RUN_AS_USER:-root}"
22+
# RUN_AS_USER: Defaults to "clauder" for non-root. Set to "root" if needed.
23+
RUN_AS_USER="${RUN_AS_USER:-clauder}"
2424

2525
export HOME="$CLAUDER_HOME"
2626
export XDG_DATA_HOME="$CLAUDER_HOME/.local/share"

0 commit comments

Comments
 (0)