bittorrent-benchmarks/docker-compose-codex.local.yaml
2025-02-14 11:00:17 -03:00

110 lines
3.0 KiB
YAML

services:
clean-volumes:
image: alpine
container_name: clean-volumes
entrypoint:
- /bin/sh
- -c
- |
echo "Cleaning data dirs..."
rm -rf /var/lib/codex1/* /var/lib/codex2/* /var/lib/codex3/*
touch /.done
echo "done."
sleep infinity
volumes:
- codex-volume-1:/var/lib/codex1
- codex-volume-2:/var/lib/codex2
- codex-volume-3:/var/lib/codex3
healthcheck:
timeout: 10s
test: [ "CMD", "test", "-f", "/.done" ]
retries: 10
interval: 1s
codex-1:
image: codexstorage/nim-codex:latest
container_name: codex-1
environment:
- CODEX_LOG_LEVEL=DEBUG
- CODEX_DATA_DIR=/var/lib/codex
- CODEX_DISC_PORT=6890
- CODEX_API_BINDADDR=0.0.0.0
- CODEX_API_PORT=6891
- CODEX_STORAGE_QUOTA=1073741824 # 1GB
- NAT_IP_AUTO=true
volumes:
- codex-volume-1:/var/lib/codex
ports:
- "6890-6891:6890-6891"
codex-agent-1:
image: bittorrent-benchmarks:test
container_name: codex-agent-1
entrypoint: [ "poetry", "run", "bittorrent-benchmarks",
"agent", "config/codex/agent.local.yaml", "codex_agent", "--port", "9000" ]
environment:
- CODEX_API_URL=http://codex-1:6891
- NODE_ID=codex-1
ports:
- "9000:9000"
codex-2:
image: codexstorage/nim-codex:latest
container_name: codex-2
environment:
- CODEX_LOG_LEVEL=DEBUG
- CODEX_DATA_DIR=/var/lib/codex
- CODEX_DISC_PORT=6892
- CODEX_API_BINDADDR=0.0.0.0
- CODEX_API_PORT=6893
- CODEX_STORAGE_QUOTA=1073741824 # 1GB
- BOOTSTRAP_NODE_URL=http://codex-1:6891
- NAT_IP_AUTO=true
volumes:
- codex-volume-2:/var/lib/codex
ports:
- "6892-6893:6892-6893"
codex-agent-2:
image: bittorrent-benchmarks:test
container_name: codex-agent-2
entrypoint: [ "poetry", "run", "bittorrent-benchmarks",
"agent", "config/codex/agent.local.yaml", "codex_agent", "--port", "9001" ]
environment:
- CODEX_API_URL=http://codex-2:6893
- NODE_ID=codex-2
ports:
- "9001:9001"
codex-3:
image: codexstorage/nim-codex:latest
container_name: codex-3
environment:
- CODEX_LOG_LEVEL=DEBUG
- CODEX_DATA_DIR=/var/lib/codex
- CODEX_DISC_PORT=6894
- CODEX_API_BINDADDR=0.0.0.0
- CODEX_API_PORT=6895
- CODEX_STORAGE_QUOTA=1073741824 # 1GB
- BOOTSTRAP_NODE_URL=http://codex-1:6891
- NAT_IP_AUTO=true
volumes:
- codex-volume-3:/var/lib/codex
ports:
- "6894-6895:6894-6895"
codex-agent-3:
image: bittorrent-benchmarks:test
container_name: codex-agent-3
entrypoint: [ "poetry", "run", "bittorrent-benchmarks",
"agent", "config/codex/agent.local.yaml", "codex_agent", "--port", "9002" ]
environment:
- CODEX_API_URL=http://codex-3:6895
- NODE_ID=codex-3
ports:
- "9002:9002"
volumes:
codex-volume-1:
codex-volume-2:
codex-volume-3: