services:
  opencode:
    container_name: opencode
    build: .
    image: opencode:latest
    ports:
      - "14096:4096"
    environment:
      # Set OPENCODE_SERVER_PASSWORD in .env or your shell environment before `docker compose up`.
      OPENCODE_SERVER_PASSWORD: ${OPENCODE_SERVER_PASSWORD}
    volumes:
      - /root/.config/opencode:/root/.config/opencode
      - /root/.local/share/opencode:/root/.local/share/opencode
      - /root/OpenCode:/root/workspace
    command:
      - web
      - --hostname
      - 0.0.0.0
      - --mdns
      - --port
      - "4096"
      - --print-logs
      - --log-level
      - DEBUG
    tty: true
    stdin_open: true
    restart: unless-stopped
