Docker swarm external metricbeat config

Hello, I cant run this external config, when launch docker compose up, thanks who will help me.
this is the warning:

$docker-compose up
WARNING: Some services (metricbeat) use the 'configs' key, which will be ignored. Compose does not support 'configs' configuration - use `docker stack deploy` to deploy to a swarm.

version: '3.7'

services:
  metricbeat:
    image: docker.elastic.co/beats/metricbeat-oss:7.12.1
    user: root
    hostname: "{{.Node.Hostname}}-{{.Service.Name}}"
    #command: metricbeat modules list
    #command: "sh metricbeat modules enable system && /dev/null"
    volumes:
      - type: bind
        source: /
        target: /hostfs
        read_only: true
      - type: bind
        source: /sys/fs/cgroup
        target: /hostfs/sys/fs/cgroup
        read_only: true
      - type: bind
        source: /proc
        target: /hostfs/proc
        read_only: true
      - type: bind
        source: /var/run/docker.sock
        target: /var/run/docker.sock
        read_only: true
    deploy:
      mode: global
    restart: on-failure
    #command: ["sh","-c","sleep 5 && metricbeat modules enable system && /dev/null"]
    command: bash -c "metricbeat modules enable system && tail -f /dev/null"
    configs:
      - source: myconfig
        target: /usr/share/metricbeat/metricbeat.yml
configs:
   myconfig:
     file: ./metricbeat.yml

Docker compose does not support configs. If you want to use configs, you will need to deploy the compose file as swarm stack, like the warning indicattes: docker stack deploy