Skip to content

wrong working dir / (root) #23076

@typoworx-de

Description

@typoworx-de

Description

I'm trying to setup opencode web inside docker, but for some reason the project (working-dir) becomes always / (docker rootfs).

docker-compose.yaml

services:
  opencode:
    image: node:20-bookworm
    working_dir: /workspace
    command: >
      sh -c "
        npm install -g opencode-ai &&
        opencode web --hostname 0.0.0.0 --port 4096 --cors '*'
      "
    ports:
      - "ports:4096"
    environment:
      OPENCODE_SERVER_PASSWORD: "${OPENCODE_SERVER_PASSWORD:-}"
      PWD: /workspace
      HOME: /workspace
    volumes:
      - ../:/workspace
      - $HOME/.local/share/opencode/auth.json:/root/.local/share/opencode/auth.json
      - ./opencode.config.json:/root/.config/opencode/config.json

Plugins

No response

OpenCode version

1.4.7

Steps to reproduce

See docker-compose.yaml above

Screenshot and/or share link

Image

Operating System

Ubuntu Linux 24 LTS + docker

Terminal

tried sh and bash (inside docker container)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwebRelates to opencode on web / desktop

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions