forked from opencode-ai/opencode
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
38 lines (36 loc) · 1.14 KB
/
docker-compose.yml
File metadata and controls
38 lines (36 loc) · 1.14 KB
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
28
29
30
31
32
33
34
35
36
37
38
services:
mysql:
image: mysql:8.0.39
container_name: opencode-mysql
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: opencode
MYSQL_USER: opencode_user
MYSQL_PASSWORD: secure_password
ports:
- "3306:3306"
volumes:
- ./tmp/mysql_data:/var/lib/mysql
- ./docker/mysql-init.sql:/docker-entrypoint-initdb.d/init.sql
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --log-bin-trust-function-creators=1 --binlog-expire-logs-seconds=432000
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-prootpassword"]
interval: 10s
timeout: 5s
retries: 5
opencode:
image: opencode:latest
container_name: opencode-agent
depends_on:
mysql:
condition: service_healthy
environment:
OPENCODE_SESSION_PROVIDER_TYPE: mysql
OPENCODE_MYSQL_DSN: "opencode_user:secure_password@tcp(opencode-mysql:3306)/opencode?parseTime=true"
volumes:
- ~/.opencode.json:/workspace/.opencode.json
- ./workspace:/workspace/project
env_file:
- .env
volumes:
mysql_data: