From 0c11ea90f684eb2292ec419d935d58b3fe24561d Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 10 Oct 2025 17:36:13 +0200 Subject: [PATCH] Docker compose: use '--service-ports' "docker compose run" does not create any of the ports specified in the service configuration by default. This is the problem for us, because user will need to specify "-p 8000:8000" or similar in docker run options, what is inconvinient. --- runo | 4 ++-- tests/unit/test_runo.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runo b/runo index 054d3cc..042f331 100755 --- a/runo +++ b/runo @@ -29,7 +29,7 @@ from typing import ( Union, ) -__version__ = "25.10.10-e879d7bf" +__version__ = "25.10.10-99069d04" # runo uses .toml format of config files, but parsers for this format # might be not available in old python versions (only in 3.11 tomllib @@ -364,7 +364,7 @@ class Composition: [self.compose_base] + self._generated_options + self._compose_options_from_config - + ["run --build"] + + ["run --build --service-ports"] + docker_run_options + [self._cfg["docker_compose_service"]] + [command_to_run] diff --git a/tests/unit/test_runo.py b/tests/unit/test_runo.py index 531d1cd..17e1ab2 100644 --- a/tests/unit/test_runo.py +++ b/tests/unit/test_runo.py @@ -1233,7 +1233,7 @@ def expected_calls(self, command: dict, run_options: List[str], env_specific_dat "docker", "compose", *expected_docker_compose_options, - "run --build", + "run --build --service-ports", ] + _expected_docker_run_options(docker_run_options_str) + [container_config["docker_compose_service"]]