services: teslamate: image:teslamate/teslamate:latest restart:always environment: -ENCRYPTION_KEY=secretkey#replace with a secure key to encrypt your Tesla API tokens -DATABASE_USER=teslamate -DATABASE_PASS=password#insert your secure database password! -DATABASE_NAME=teslamate -DATABASE_HOST=database -MQTT_HOST=mosquitto ports: -4000:4000 volumes: -./import:/opt/app/import cap_drop: -all
# Stop the teslamate container to avoid write conflicts docker compose stop teslamate
# Drop existing data and reinitialize (Don't forget to replace first teslamate if using different TM_DB_USER) docker compose exec -T database psql -U teslamate teslamate << . DROP SCHEMA public CASCADE; CREATE SCHEMA public; CREATE EXTENSION cube WITH SCHEMA public; CREATE EXTENSION earthdistance WITH SCHEMA public; .