We have a number of "in_container" scripts written in Bash, They are doing a number of houseekeeping stuff but since we already have Python 3.7+ inside the CI image, we could modularise them more and make them run from external and simplify entrypoint_ci (for example separate script for tests).
down_command_to_execute = ["docker", "compose"]
    if shell_params.project_name:
        down_command_to_execute.extend(["--project-name", shell_params.project_name])
    down_command_to_execute.extend(["down", "--remove-orphans"])
    if not preserve_volumes:
        down_command_to_execute.append("--volumes")
    run_command(
        down_command_to_execute,
        text=True,
        check=False,
        capture_output=shell_params.quiet,
        env=shell_params.env_variables_for_docker_commands,
    )
def execute_command_in_shell(
    shell_params: ShellParams, project_name: str, command: str | None = None
) -> RunCommandResult:
    """Executes command in shell.
    When you want to execute a script/bash command inside the CI container and want to use `enter_shell`
    for this purpose, the helper methods sets the following parameters of shell_params:
    * backend - to force sqlite backend
    * clean_sql_db=True - to clean the sqlite DB
    * executor - to force SequentialExecutor
    * forward_ports=False - to avoid forwarding ports from the container to the host - again that will
      allow to avoid clashes with other commands and opened breeze shell
    * project_name - to avoid name clashes with default "breeze" project name used
    * quiet=True - avoid displaying all "interactive" parts of Breeze: ASCIIART, CHEATSHEET, some diagnostics
    * skip_environment_initialization - to avoid initializing interactive environment