From f19499303cb04075ba24c05b52bbb6139088f35b Mon Sep 17 00:00:00 2001 From: Preston Hunter Date: Sat, 15 Nov 2025 08:25:49 -0500 Subject: [PATCH] refactor(teslamate): Streamline Docker Compose configuration Enabled port mappings for Teslamate, Grafana, and Mosquitto services to make them accessible from the host. Renamed the internal Docker network from `teslamate-internal` to `teslamate` for consistency. Removed the `pangolin-home` external network from service definitions and its declaration, as it is no longer required. Simplified volume definitions by removing explicit `driver: local` and `driver_opts`. This transitions volumes from specific host bind mounts to Docker-managed named volumes, improving portability and simplifying management. --- teslamate/docker-compose.yml | 48 ++++++++++-------------------------- 1 file changed, 13 insertions(+), 35 deletions(-) diff --git a/teslamate/docker-compose.yml b/teslamate/docker-compose.yml index 161c378..b649269 100644 --- a/teslamate/docker-compose.yml +++ b/teslamate/docker-compose.yml @@ -9,8 +9,8 @@ services: - DATABASE_NAME=teslamate - DATABASE_HOST=database - MQTT_HOST=mosquitto -# ports: -# - 4000:4000 + ports: + - 4000:4000 volumes: - /mnt/docker/home/teslamate/import:/opt/app/import cap_drop: @@ -18,8 +18,8 @@ services: secrets: - password networks: - - teslamate-internal - - pangolin-home + - teslamate +# - pangolin-home database: image: postgres:18-trixie @@ -33,7 +33,7 @@ services: secrets: - password networks: - - teslamate-internal + - teslamate grafana: image: teslamate/grafana:latest @@ -43,29 +43,29 @@ services: - DATABASE_PASS=/run/secrets/password - DATABASE_NAME=teslamate - DATABASE_HOST=database -# ports: -# - 3000:3000 + ports: + - 3000:3000 volumes: - teslamate-grafana-data:/var/lib/grafana secrets: - password networks: - - teslamate-internal - - pangolin-home + - teslamate +# - pangolin-home mosquitto: image: eclipse-mosquitto:2 restart: always command: mosquitto -c /mosquitto-no-auth.conf - # ports: - # - 1883:1883 + ports: + - 1883:1883 volumes: - mosquitto-conf:/mosquitto/config - mosquitto-data:/mosquitto/data secrets: - password networks: - - teslamate-internal + - teslamate secrets: password: @@ -74,31 +74,9 @@ secrets: networks: teslamate-internal: driver: overlay - pangolin-home: - external: true volumes: teslamate-db: - driver: local - driver_opts: - type: none - device: /mnt/docker/home/teslamate/data - o: bind teslamate-grafana-data: - driver: local - driver_opts: - type: none - device: /mnt/docker/home/teslamate/data - o: bind mosquitto-conf: - driver: local - driver_opts: - type: none - device: /mnt/docker/home/teslamate/data - o: bind - mosquitto-data: - driver: local - driver_opts: - type: none - device: /mnt/docker/home/teslamate/data - o: bind \ No newline at end of file + mosquitto-data: \ No newline at end of file