Change portnumber in docker compose


I am not very familiar with docker compose etc.
Now I want to use frigate and found a compose-setup (???) for it.

Now I have to change the portnumber of mqtt in it because it is not the defautl port.

I suppose it should be very easy to add the correct line, but I cannot find how to do that.

This is my docker compose and I hope someone can tell me what to add. I I should ask it somewhere else please let me know.

version: "3.9"
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: blakeblackshear/frigate:stable
    shm_size: "64mb" # update for your cameras based on calculation above
   #   - /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
   #   - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here
   #   - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
      - /etc/localtime:/etc/localtime:ro
      - /volume1/docker/frigate/config.yml:/config/config.yml:ro
      - /volume1/docker/frigate/media:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
          size: 1000000000
      - "5020:5000"
      - "1935:1935" # RTMP feeds
      FRIGATE_RTSP_PASSWORD: "password"

Where is mqtt? If it is inside the firgate container, then you could create a new image based on the one that you use now or just mount a different configuration into the container for mqtt. It depends on how mqtt works which I don’t know.

And it mqtt is inside the container and you want to access it from ouside a container you can forward any port to the one that mqtt listens on.

It runs in a seperate container