version: "3"

networks:
  app-tier-traccar:
    driver: bridge

services:
    mysql-traccar:
        image: mysql:8.0.20
        container_name: mysql-traccar
        command: --default-authentication-plugin=mysql_native_password
        restart: unless-stopped
        volumes:
            - /home/icke/mysql-traccar/traccar/mysql-data:/var/lib/mysql
            - /home/icke/mysql-traccar/mysql:/etc/mysql/conf.d
        ports:
            - "3306:3306"
        environment:
            - MYSQL_ROOT_PASSWORD=eccmts42**
        networks:
            - app-tier-traccar


    traccar:
        image: traccar/traccar:latest
        container_name: traccar
        depends_on:
           - mysql-traccar
        restart: unless-stopped
        volumes:
            - /home/icke/traccar/traccar.xml:/opt/traccar/conf/traccar.xml:ro
            - /home/icke/traccar/logs:/opt/traccar/logs:rw
        ports:
            - "5000-5150:5000-5150"
            - "8092:8082"
        environment:
           - MYSQL_DATABASE=traccar
           - MYSQL_USER=traccar
           - MYSQL_PASSWORD=eccmts42*
        networks:
            - app-tier-traccar

volumes:
   mysql-data:
   mysql:
   logs: