Skip to content

Instantly share code, notes, and snippets.

@danielraffel
Created January 12, 2024 19:17
Show Gist options
  • Save danielraffel/69274fa18afc2c7b2fd269f0aaa5abbb to your computer and use it in GitHub Desktop.
Save danielraffel/69274fa18afc2c7b2fd269f0aaa5abbb to your computer and use it in GitHub Desktop.
Docker Compose for Teslamate on GCP
version: "3"
services:
teslamate:
image: teslamate/teslamate:latest
restart: always
environment:
- ENCRYPTION_KEY= #replace with a secure key to encrypt your Tesla API tokens
- DATABASE_USER=teslamate
- DATABASE_PASS= #add your secure database password!
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
- MQTT_HOST=mosquitto
ports:
- 4000:4000
volumes:
- ./import:/opt/app/import
cap_drop:
- all
database:
image: postgres:15
restart: always
environment:
- POSTGRES_USER=teslamate
- POSTGRES_PASSWORD= #add your secure database password!
- POSTGRES_DB=teslamate
volumes:
- teslamate-db:/var/lib/postgresql/data
grafana:
image: teslamate/grafana:latest
restart: always
environment:
- DATABASE_USER=teslamate
- DATABASE_PASS= #add a secure database password!
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
ports:
- 3000:3000
volumes:
- teslamate-grafana-data:/var/lib/grafana
mosquitto:
image: eclipse-mosquitto:2
restart: always
command: mosquitto -c /mosquitto-no-auth.conf
# ports:
# - 1883:1883
volumes:
- mosquitto-conf:/mosquitto/config
- mosquitto-data:/mosquitto/data
volumes:
teslamate-db:
teslamate-grafana-data:
mosquitto-conf:
mosquitto-data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment