c182ada0dd
Zoxide stores its database at ~/.local/share/zoxide/db.zo. Without a named volume, the 'z <fragment>' jump targets are lost on every 'docker compose up --force-recreate'. Add devbox-zoxide named volume in docker-compose.yml and docker-compose.shared.yml, add ~/.local/share/zoxide to the entrypoint ownership-fix loop per AGENTS.md convention, and update the data-persistence tables in README.md and DOCKER_HUB.md.
69 lines
2.4 KiB
YAML
69 lines
2.4 KiB
YAML
# 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 ~/<signum>/opencode-devbox && cd ~/<signum>/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 ~/<signum>/.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=<unique-id> 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
|
|
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
|
|
|
|
# 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 <fragment>' to jump)
|
|
- devbox-zoxide:/home/developer/.local/share/zoxide
|
|
|
|
# Persist uv data (Python installs)
|
|
- devbox-uv:/home/developer/.local/share/uv
|
|
|
|
# Optional: AWS credentials (per-user if available)
|
|
# - ${HOME}/${SIGNUM}/.aws:/home/developer/.aws
|
|
|
|
volumes:
|
|
devbox-data:
|
|
devbox-shell-history:
|
|
devbox-zoxide:
|
|
devbox-uv:
|