How to assign a container an IP in IPVLAN L3 docker network in docker-compose.yml

Hello,

I have created an IPVLAN Layer 3 network on docker with a few subnets.
I can create a container and assign it an IP address with docker run but I was wondering how to configure this with docker compose.
Can someone help me please?
For reference the run command is sth like (let’s say that192.168.50.0/24 is one of the subnets and that the name of the ipvlan network is ipvlanL3_network)
docker run -itd --rm --network ipvlanL3_network --ip 192.168.50.2 --name test /bin/bash

Is it as simple as doing:

services:
  my_service:
    image: my_image
    command: run_my_command
    networks: 
      ipvlanL3_network:
        ipv4_address: 192.168.50.2

networks:
  ipvlanL3_network:
    external: true

#ipvlan#docker-compose

Looks good to me.

You might want to make it a habit to lookup compose configuration items in the compose specificiation.