version: "3"

services:
  teslamate:
    image: teslamate/teslamate:latest
    environment:
      - ENCRYPTION_KEY=ganopacha007
      - DATABASE_USER=teslamate
      - DATABASE_PASS=ganopacha007
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
      - MQTT_HOST=192.168.10.39
      - MQTT_PORT=1883
      - MQTT_USERNAME=hadash
      - MQTT_PASSWORD=hadash
    ports:
      - 4000:4000
    volumes:
      - ./import:/opt/app/import
    cap_drop:
      - all

  database:
    image: postgres:14
    restart: always
    environment:
      - POSTGRES_USER=teslamate
      - POSTGRES_PASSWORD=ganopacha007
      - POSTGRES_DB=teslamate
    volumes:
      - teslamate-db:/var/lib/postgresql/data

  grafana:
    image: teslamate/grafana:latest
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=ganopacha007
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
    ports:
      - 3010:3000
    volumes:
      - teslamate-grafana-data:/var/lib/grafana

volumes:
  teslamate-db:
  teslamate-grafana-data:
