| services: | |
| openevolve: | |
| build: . | |
| image: openevolve | |
| # Pass API keys from host environment (set in .env or shell) | |
| environment: | |
| - OPENAI_API_KEY=${OPENAI_API_KEY:-} | |
| - GEMINI_API_KEY=${GEMINI_API_KEY:-} | |
| - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-} | |
| volumes: | |
| # Mount project dir so code changes take effect without rebuilding | |
| - .:/app | |
| # Persist evolution output across runs | |
| - ./output:/app/output | |
| network_mode: host | |
| # Default: run the function_minimization example | |
| # Override with: docker compose run openevolve <initial.py> <evaluator.py> --config ... | |
| command: > | |
| examples/function_minimization/initial_program.py | |
| examples/function_minimization/evaluator.py | |
| --config examples/function_minimization/config.yaml | |
| --iterations 10 | |
| # Interactive shell for debugging / exploration | |
| shell: | |
| build: . | |
| image: openevolve | |
| environment: | |
| - OPENAI_API_KEY=${OPENAI_API_KEY:-} | |
| - GEMINI_API_KEY=${GEMINI_API_KEY:-} | |
| - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-} | |
| volumes: | |
| - .:/app | |
| - ./output:/app/output | |
| network_mode: host | |
| entrypoint: /bin/bash | |
| stdin_open: true | |
| tty: true |