containerized
dev_tool.services.execution.containerized
log = logging.getLogger(__name__)
module-attribute
ContainerizedExecutionStrategy
Bases: ExecutionStrategy, BaseService
An execution strategy for fully containerized development.
Both Django and PostgreSQL run in Docker containers via docker-compose.
The constructor for the ContainerizedExecutionStrategy class.
Parameters:
-
configuration(ConfigManager) –The configuration manager instance.
-
project_name(str) –The name of the project.
Source code in dev_tool/services/execution/containerized.py
build_shared_app_image
A method that builds the shared app image.
Parameters:
-
force(bool, default:False) –Whether to force a rebuild even if image exists.
Source code in dev_tool/services/execution/containerized.py
cleanup
A method that cleans up temporary build context directories.
Source code in dev_tool/services/execution/containerized.py
ensure_database
A method that ensures Docker services are running.
Parameters:
-
recreate(bool, default:False) –Whether to recreate the containers.
Source code in dev_tool/services/execution/containerized.py
run_bun_command
A method that executes a Bun command in the container.
Parameters:
-
args(list[str]) –The command arguments.
-
kwargs(Any, default:{}) –Additional subprocess arguments.
Returns:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/execution/containerized.py
run_createsuperuser
A method that creates a Django superuser with environment variables.
Parameters:
Returns:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/execution/containerized.py
run_django_command
A method that executes a Django management command in the container.
Parameters:
-
args(list[str]) –The command arguments.
-
kwargs(Any, default:{}) –Additional subprocess arguments.
Returns:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/execution/containerized.py
run_pip_command
A method that executes a uv pip command in the container.
Parameters:
-
args(list[str]) –The command arguments.
-
kwargs(Any, default:{}) –Additional subprocess arguments.
Returns:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/execution/containerized.py
run_python_command
A method that executes a Python command in the container.
Parameters:
-
args(list[str]) –The command arguments.
-
kwargs(Any, default:{}) –Additional subprocess arguments.
Returns:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/execution/containerized.py
run_seed
A method that runs the database seeding script in the container.
Parameters:
-
seed_script(Path) –The path to the seed script.
Source code in dev_tool/services/execution/containerized.py
run_server
A method that starts the Django development server in the container.
Parameters:
-
ip_address(str) –The IP address to bind to (ignored, uses 0.0.0.0 inside container).
-
port(int) –The port number to bind to.
Source code in dev_tool/services/execution/containerized.py
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 | |
run_shell_script
A method that executes a Django shell script in the container.
Parameters:
-
script(str) –The Python script to execute in Django shell.
-
kwargs(Any, default:{}) –Additional subprocess arguments.
Returns:
-
CompletedProcess–The completed process result.