File size: 686 Bytes
3a63028
 
34ef861
3a63028
34ef861
3a63028
 
34ef861
3a63028
 
 
 
 
 
34ef861
3a63028
 
34ef861
3a63028
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
version: "3.8"

services:
  opencode:
    build: .
    ports:
      - "4096:4096"
    environment:
      # Set your API keys here
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
      - OPENAI_API_KEY=${OPENAI_API_KEY:-}
      # Optional: enable HTTP basic auth
      - OPENCODE_SERVER_USERNAME=${OPENCODE_SERVER_USERNAME:-}
      - OPENCODE_SERVER_PASSWORD=${OPENCODE_SERVER_PASSWORD:-}
    volumes:
      # Mount a directory for projects to persist data
      - opencode-data:/projects
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:4096/api/health"]
      interval: 30s
      timeout: 5s
      retries: 3

volumes:
  opencode-data: