diff --git a/README.md b/README.md index 022b81b..7ee5202 100755 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ There are multiple containers: - Virtual Fleet Management - application simulating Fleet Management. It creates orders for cars. - PostgreSQL database - storage of the HTTP API keys and the messages sent via the API - Mission Module Display Tool - a simple web server to display the positions of vehicles on a map +- Log files initialization service - a Ubuntu based container which sets correct permissions for docker_volumes ## Container Repositories @@ -177,8 +178,8 @@ Actual MQTT topics to which developers can connect by default settings are: ## Logs Logs for each component can be found in the `docker_volumes` directory. -> The component directories are pre-created in the repository to avoid permission problems associated with docker -> volumes. +> The component directories are pre-created in the repository. To avoid permission problems associated with docker +> volumes, a service automatically sets the correct ownership of files before running other components. In case of a problem, please attach the `docker_volumes` directory to the Bug report. diff --git a/docker-compose.yml b/docker-compose.yml index 899d3e4..04e2d43 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: virtual-vehicle: - image: bringauto/virtual-vehicle:v3.1.6 + image: bringauto/virtual-vehicle:v3.1.7 profiles: ["all", "without-module-gateway", "without-external-server", "core", "virtual-vehicle", "without-fleet-management"] volumes: - ./docker_volumes/virtual-vehicle-utility:/virtual-vehicle-utility/log @@ -11,6 +11,9 @@ services: restart: "no" networks: - bring-emulator + depends_on: + initialize-log-folders: + condition: service_completed_successfully virtual-plc: image: bringauto/virtual-plc:v1.0.0 @@ -23,9 +26,12 @@ services: restart: "no" networks: - bring-emulator + depends_on: + initialize-log-folders: + condition: service_completed_successfully module-gateway: - image: bringauto/module-gateway:v1.1.6 + image: bringauto/module-gateway:v1.2.0 profiles: ["all", "without-devices", "without-external-server", "module-gateway", "core", "without-fleet-management"] volumes: - ./docker_volumes/module-gateway:/home/bringauto/log/ @@ -38,6 +44,9 @@ services: restart: "no" networks: - bring-emulator + depends_on: + initialize-log-folders: + condition: service_completed_successfully vernemq: image: bringauto/vernemq:1.13.0 @@ -51,19 +60,23 @@ services: restart: "no" networks: - bring-emulator + depends_on: + initialize-log-folders: + condition: service_completed_successfully external-server: - image: bringauto/external-server:v1.1.9 + image: bringauto/external-server:v1.1.14 profiles: ["all", "without-devices", "without-module-gateway", "without-fleet-management", "external_server", "cloud"] volumes: - ./docker_volumes/external-server:/home/bringauto/log - ./configuration/external-server:/home/bringauto/config/ - entrypoint: ["python3", - "/home/bringauto/external_server/external_server_main.py", - "--config=/home/bringauto/config/config.json" ] + command: -c /home/bringauto/config/config.json restart: "no" networks: - bring-emulator + depends_on: + initialize-log-folders: + condition: service_completed_successfully http-api: image: bringauto/fleet-protocol-http-api:v2.4.2 @@ -94,6 +107,9 @@ services: - ./docker_volumes/integration-layer:/usr/src/app/log entrypoint: ["python3", "-m", "fleetman_integration", "config/config.json"] + depends_on: + initialize-log-folders: + condition: service_completed_successfully management-api: image: bringauto/fleet-management-http-api:v3.1.6 @@ -146,6 +162,9 @@ services: - 5432:5432 volumes: - ./db/insert_test_api_key.sh:/docker-entrypoint-initdb.d/insert_test_api_key.sh + depends_on: + initialize-log-folders: + condition: service_completed_successfully mission-module-display-tool: image: bringauto/mission-module-display-tool:v1.0.0 @@ -158,6 +177,18 @@ services: volumes: - ./configuration/mission-module-display-tool/config.json:/mission-module-display-tool/config/config-docker.json command: --config=config/config-docker.json + depends_on: + initialize-log-folders: + condition: service_completed_successfully + + initialize-log-folders: + image: ubuntu:24.04 + restart: "no" + volumes: + - ./docker_volumes:/docker_volumes + entrypoint: + ["/usr/bin/chown", "-R", "5000:5000", "/docker_volumes/module-gateway", "/docker_volumes/external-server", + "/docker_volumes/virtual-vehicle-utility"] networks: bring-emulator: diff --git a/scripts/docker_compose_config.json b/scripts/docker_compose_config.json index a2e5e64..8e73ab9 100644 --- a/scripts/docker_compose_config.json +++ b/scripts/docker_compose_config.json @@ -66,6 +66,12 @@ "replace": false, "path": "../../mission-module-display-tool", "force_rebuild": false + }, + { + "name": "initialize-log-folders", + "replace": false, + "path": "", + "force_rebuild": false } ] } \ No newline at end of file