networks:
  traccar-network:
    driver: bridge

services:
  traccar:
    image: traccar/traccar:6.10
    container_name: ${CONTAINER_NAME}
    labels:
      createdBy: "Apps"
    restart: always
    networks:
      - traccar-network
    ports:
      - ${PANEL_APP_PORT_HTTP}:8082
    env_file:
      - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
      - ${ENV_FILE:-/etc/1panel/envs/default.env}
    volumes:
      - ${TRACCAR_ROOT_PATH}/logs:/opt/traccar/logs:rw
      - ${TRACCAR_ROOT_PATH}/data:/opt/traccar/data:rw
    environment:
      - CONFIG_USE_ENVIRONMENT_VARIABLES=true
      - WEB_URL=${WEB_URL:-http://127.0.0.1:8082}
      - DATABASE_DRIVER=${DATABASE_DRIVER:-org.h2.Driver}
      - DATABASE_URL=${DATABASE_URL:-jdbc:h2:./data/database}
      - DATABASE_USER=${DATABASE_USER:-sa}
      - DATABASE_PASSWORD=${DATABASE_PASSWORD:-}
