From 89a57df45fd92a26a47aa06cc6a634b27d544ff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Carvalho?= Date: Sun, 3 Jul 2022 21:33:23 +0100 Subject: [PATCH] Add devcontainer-specific configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Carvalho --- .devcontainer/config.json | 17 +++++++++++++++++ .devcontainer/docker-compose-devcontainer.yaml | 3 +++ Makefile | 9 +++++++-- test/app_instance.py | 8 ++++---- 4 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 .devcontainer/config.json diff --git a/.devcontainer/config.json b/.devcontainer/config.json new file mode 100644 index 0000000..3943043 --- /dev/null +++ b/.devcontainer/config.json @@ -0,0 +1,17 @@ +{ + "result_backend": { + "redis": { + "url": "redis://redis:6379/0" + } + }, + "state_backend": { + "redis": { + "url": "redis://redis:6379/0" + } + }, + "broker": { + "amqp": { + "url": "amqp://rabbitmq:5672" + } + } +} \ No newline at end of file diff --git a/.devcontainer/docker-compose-devcontainer.yaml b/.devcontainer/docker-compose-devcontainer.yaml index 6ea8279..ad09b8e 100644 --- a/.devcontainer/docker-compose-devcontainer.yaml +++ b/.devcontainer/docker-compose-devcontainer.yaml @@ -17,6 +17,9 @@ services: - vscode_server_data:/home/vscode/.vscode-server - cache:/home/vscode/.cache + environment: + - MOGNET_CONFIG_FILE=/workspaces/project-mognet/.devcontainer/config.json + command: - bash - -c diff --git a/Makefile b/Makefile index bab87c2..4e446f8 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,13 @@ lint: lint-isort lint-black lint-pylint docker-up: @docker-compose \ -f $(DOCKER_COMPOSE_FILE) \ - up -d \ - --remove-orphans + up -d + +.PHONY: docker-down +docker-down: + @docker-compose \ + -f $(DOCKER_COMPOSE_FILE) \ + down .PHONY: test test: diff --git a/test/app_instance.py b/test/app_instance.py index 3cd171e..7de65bd 100644 --- a/test/app_instance.py +++ b/test/app_instance.py @@ -15,18 +15,18 @@ def get_config(): - config_file_path = Path(os.getenv("MOGNET_TEST_CONFIG_FILE", "config.json")) + config_file_path = Path(os.getenv("MOGNET_CONFIG_FILE", "config.json")) if config_file_path.is_file(): return AppConfig.parse_file(config_file_path) return AppConfig( result_backend=ResultBackendConfig( - redis=RedisResultBackendSettings(url="redis://redis") + redis=RedisResultBackendSettings(url="redis://localhost:6379/0") ), - broker=BrokerConfig(amqp=AmqpBrokerSettings(url="amqp://rabbitmq")), + broker=BrokerConfig(amqp=AmqpBrokerSettings(url="amqp://localhost:5672")), state_backend=StateBackendConfig( - redis=RedisStateBackendSettings(url="redis://redis") + redis=RedisStateBackendSettings(url="redis://localhost:6379/0") ), task_routes={}, minimum_concurrency=1,