# opencode-devbox docker-compose for shared machines # # For machines where multiple users share one OS account (e.g. 'garage'). # Each user gets isolated config, data, and named volumes by setting # SIGNUM in their .env file. # # Setup per user: # 1. mkdir -p ~//opencode-devbox && cd ~//opencode-devbox # 2. cp docker-compose.shared.yml docker-compose.yml # 3. cp .env.shared.example .env # 4. Edit .env with your signum, provider, keys, etc. # 5. mkdir -p ~//.config/opencode # 6. docker compose up -d # # Volume isolation: the top-level 'name:' field derives a unique project # name per user, which Docker Compose uses as the prefix for all named # volumes. Without this, two users whose compose file lives in a directory # with the same basename would share volumes — the Docker daemon is # system-wide and doesn't scope by OS user. # # Two modes: # Own-account mode (each user has their own OS login): # Leave SIGNUM unset in .env — it defaults to $USER automatically. # Shared-account mode (everyone logs in as the same OS user): # Set SIGNUM= in .env so each person gets isolated volumes. name: devbox-${SIGNUM:-${USER}} services: devbox: image: joakimp/opencode-devbox:latest container_name: devbox-${SIGNUM:-${USER}} stdin_open: true tty: true env_file: - .env environment: - TERM=xterm-256color - GITEA_ACCESS_TOKEN=${GITEA_ACCESS_TOKEN:-} - GITEA_HOST=${GITEA_HOST:-} volumes: # Host workspace — user's project directory - ${WORKSPACE_PATH:-~/src}:/workspace # SSH keys — user-specific if available, else shared - ${SSH_KEY_PATH:-~/.ssh}:/home/developer/.ssh:ro # Optional: mount skillset repo for automatic skill/instruction deployment. # The entrypoint runs deploy-skills.sh --bootstrap on start, creating # relative symlinks that resolve inside the container regardless of # where the repo lives on the host. Set SKILLSET_PATH in .env. # - ${SKILLSET_PATH}:/home/developer/skillset # Opencode config — per-user (persists settings across restarts) - ${HOME}/${SIGNUM}/.config/opencode:/home/developer/.config/opencode # Persist opencode data (auth, memory, session history) - devbox-data:/home/developer/.local/share/opencode # Persist bash history across container recreations - devbox-shell-history:/home/developer/.cache/bash # Persist zoxide directory history ('z ' to jump) - devbox-zoxide:/home/developer/.local/share/zoxide # Persist neovim plugin/Mason data (avoids re-downloading on every recreate) - devbox-nvim-data:/home/developer/.local/share/nvim # Persist uv data (Python installs) - devbox-uv:/home/developer/.local/share/uv # Optional: persist MemPalace data (conversation memory, knowledge graph) # - devbox-palace:/home/developer/.mempalace # Optional: persist ChromaDB embedding model cache (~79 MB) # - devbox-chroma-cache:/home/developer/.cache/chroma # Optional: AWS credentials (per-user if available) # - ${HOME}/${SIGNUM}/.aws:/home/developer/.aws volumes: devbox-data: devbox-shell-history: devbox-zoxide: devbox-nvim-data: devbox-uv: # devbox-palace: # devbox-chroma-cache: