MCPcopy
hub / github.com/HKUDS/DeepCode / launch_docker

Function launch_docker

deepcode.py:482โ€“520  ยท  view source on GitHub โ†—

Launch DeepCode via Docker

()

Source from the content-addressed store, hash-verified

480
481
482def launch_docker():
483 """Launch DeepCode via Docker"""
484 current_dir, compose_file, compose_args = _check_docker_prerequisites()
485
486 print("๐Ÿณ Starting DeepCode with Docker...")
487 print("=" * 50)
488
489 try:
490 # Check if image exists (auto-build on first run)
491 result = subprocess.run(
492 compose_args + ["images", "-q"], capture_output=True, text=True
493 )
494 if not result.stdout.strip():
495 print(
496 "๐Ÿ“ฆ First run detected โ€” building Docker image (may take a few minutes)..."
497 )
498 subprocess.run(compose_args + ["build"], check=True)
499
500 # Start (if already running, docker compose will detect and skip)
501 subprocess.run(compose_args + ["up", "-d"], check=True)
502
503 print("")
504 print("=" * 50)
505 print("โœ… DeepCode is running!")
506 print("")
507 print(" ๐ŸŒ Open: http://localhost:8000")
508 print(" ๐Ÿ“š Docs: http://localhost:8000/docs")
509 print("")
510 print(" ๐Ÿ“‹ View logs: docker logs deepcode -f")
511 print(
512 " ๐Ÿ›‘ Stop: docker compose -f deepcode_docker/docker-compose.yml down"
513 )
514 print("=" * 50)
515
516 except subprocess.CalledProcessError as e:
517 print(f"\nโŒ Docker failed: {e}")
518 sys.exit(1)
519 except KeyboardInterrupt:
520 print("\n๐Ÿ›‘ Cancelled")
521
522
523def launch_docker_cli():

Callers 1

mainFunction ยท 0.85

Calls 2

_check_docker_prerequisitesFunction ยท 0.85
runMethod ยท 0.80

Tested by

no test coverage detected