opencode-container/docker-compose.yaml
2026-01-13 13:48:49 +09:00

38 lines
970 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

services:
opencode:
image: opencode-arch
build:
context: .
dockerfile: Dockerfile
args:
USERNAME: "${USER}"
UID: "${UID}"
GID: "${GID}"
user: "${UID}:${GID}"
working_dir: "${PWD}"
stdin_open: true
tty: true
environment:
XDG_DATA_HOME: "${XDG_DATA_HOME}"
XDG_CONFIG_HOME: "${XDG_CONFIG_HOME}"
XDG_STATE_HOME: "${XDG_STATE_HOME}"
XDG_CACHE_HOME: "${XDG_CACHE_HOME}"
UID: "${UID}"
GID: "${GID}"
volumes:
# Current project (readwrite)
- "${PWD}:${PWD}"
# OpenCode persistence (host directories, writable)
- "${XDG_DATA_HOME}/opencode:${XDG_DATA_HOME}/opencode"
- "${XDG_CONFIG_HOME}/opencode:${XDG_CONFIG_HOME}/opencode"
- "${XDG_STATE_HOME}/opencode:${XDG_STATE_HOME}/opencode"
- "${XDG_CACHE_HOME}/opencode:${XDG_CACHE_HOME}/opencode"
cap_drop:
- ALL
security_opt:
- no-new-privileges:true