@@ -21,6 +21,23 @@ Steps:
2121> ** Important:** After deploying, verify that a Railway Volume is attached.
2222> Without a volume, all data is lost on every redeploy.
2323
24+ ## Template from Compose File (Manual Upload)
25+
26+ If you are creating a Railway template by importing a Compose file, use
27+ ` docker-compose.railway.yml ` from this repository.
28+
29+ Do ** not** import the root ` docker-compose.yml ` for Railway templates. That
30+ file is local/quick-deploy oriented and declares six volumes.
31+
32+ ``` bash
33+ curl -O https://raw.githubusercontent.com/pRizz/opencode-cloud/main/docker-compose.railway.yml
34+ ```
35+
36+ Railway template import supports one volume per service. The Railway-specific
37+ compose file keeps a single persisted mount at
38+ ` /home/opencoder/.local/share/opencode ` for compatibility.
39+ It keeps variable-driven runtime/logging knobs where Railway supports them and
40+ uses a fixed image reference to avoid Railway parser issues.
2441## Manual Deployment
2542
2643### Prerequisites
@@ -155,13 +172,31 @@ the build logs.
155172- Verify the image tag exists on Docker Hub
156173- Check Railway deployment logs for errors
157174
158- ### Volume permissions
175+ ### ` EACCES ` creating ` /home/opencoder/.local/share/opencode/bin `
176+
177+ ** Symptom:** Deploy logs repeatedly show:
178+
179+ ``` text
180+ EACCES: permission denied, mkdir '/home/opencoder/.local/share/opencode/bin'
181+ ```
182+
183+ ** Cause:** The Railway volume is mounted with root ownership, but the app runs
184+ as ` opencoder ` . If the mounted path is not writable by ` opencoder ` , startup
185+ fails.
186+
187+ ** Immediate workaround (Railway service settings):**
188+ 1 . Ensure ` RAILWAY_RUN_UID=0 ` (or remove a conflicting non-root value).
189+ 2 . Set the service ** Start Command** to:
190+
191+ ``` bash
192+ /bin/sh -c ' install -d -m 0755 /home/opencoder/.local/share/opencode && chown -R opencoder:opencoder /home/opencoder/.local/share/opencode && exec /usr/local/bin/entrypoint.sh'
193+ ```
194+
195+ After redeploy, the ` EACCES ` lines should stop.
159196
160- Railway volumes require the container to run as root. The opencode-cloud
161- image runs its entrypoint as root (which then drops privileges for the
162- application), so this should work without additional configuration. If you
163- encounter permission errors, ensure ` RAILWAY_RUN_UID=0 ` is not explicitly
164- set to a non-root value.
197+ ** Long-term behavior:** Recent images auto-check this mount on startup and
198+ attempt to fix ownership before launching opencode. Keep the volume mounted at
199+ ` /home/opencoder/.local/share/opencode ` .
165200
166201## Limitations
167202
0 commit comments