'Docker Compose with multiple Network

Does anyone know how to properly deploy this? I keep getting a string error. I have two apps in my compose file, i want to network one via mac-vlan for front-end and a bridge for the backend.

App Config

 networks:
      - backend
      - network-name:
          ipv4_address: x.x.x.x

Defining network

networks:
    network-name:
        external:
            name: network-name
    backend:
        driver: bridge

Error

services.service-name.networks contains {"network-name": {"ipv4_address": "x.x.x.x"}}, which is an invalid type, it should be a string


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source