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.
This commit is contained in:
Preston Hunter
2025-11-15 08:25:49 -05:00
parent 883d978aff
commit f19499303c

View File

@@ -9,8 +9,8 @@ services:
- DATABASE_NAME=teslamate - DATABASE_NAME=teslamate
- DATABASE_HOST=database - DATABASE_HOST=database
- MQTT_HOST=mosquitto - MQTT_HOST=mosquitto
# ports: ports:
# - 4000:4000 - 4000:4000
volumes: volumes:
- /mnt/docker/home/teslamate/import:/opt/app/import - /mnt/docker/home/teslamate/import:/opt/app/import
cap_drop: cap_drop:
@@ -18,8 +18,8 @@ services:
secrets: secrets:
- password - password
networks: networks:
- teslamate-internal - teslamate
- pangolin-home # - pangolin-home
database: database:
image: postgres:18-trixie image: postgres:18-trixie
@@ -33,7 +33,7 @@ services:
secrets: secrets:
- password - password
networks: networks:
- teslamate-internal - teslamate
grafana: grafana:
image: teslamate/grafana:latest image: teslamate/grafana:latest
@@ -43,29 +43,29 @@ services:
- DATABASE_PASS=/run/secrets/password - DATABASE_PASS=/run/secrets/password
- DATABASE_NAME=teslamate - DATABASE_NAME=teslamate
- DATABASE_HOST=database - DATABASE_HOST=database
# ports: ports:
# - 3000:3000 - 3000:3000
volumes: volumes:
- teslamate-grafana-data:/var/lib/grafana - teslamate-grafana-data:/var/lib/grafana
secrets: secrets:
- password - password
networks: networks:
- teslamate-internal - teslamate
- pangolin-home # - pangolin-home
mosquitto: mosquitto:
image: eclipse-mosquitto:2 image: eclipse-mosquitto:2
restart: always restart: always
command: mosquitto -c /mosquitto-no-auth.conf command: mosquitto -c /mosquitto-no-auth.conf
# ports: ports:
# - 1883:1883 - 1883:1883
volumes: volumes:
- mosquitto-conf:/mosquitto/config - mosquitto-conf:/mosquitto/config
- mosquitto-data:/mosquitto/data - mosquitto-data:/mosquitto/data
secrets: secrets:
- password - password
networks: networks:
- teslamate-internal - teslamate
secrets: secrets:
password: password:
@@ -74,31 +74,9 @@ secrets:
networks: networks:
teslamate-internal: teslamate-internal:
driver: overlay driver: overlay
pangolin-home:
external: true
volumes: volumes:
teslamate-db: teslamate-db:
driver: local
driver_opts:
type: none
device: /mnt/docker/home/teslamate/data
o: bind
teslamate-grafana-data: teslamate-grafana-data:
driver: local
driver_opts:
type: none
device: /mnt/docker/home/teslamate/data
o: bind
mosquitto-conf: mosquitto-conf:
driver: local mosquitto-data:
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