version: '3.8'

services:
    gnb_cucp:
        image: oai-gnb:latest
        privileged: true
        container_name: sa-cucp-gnb
        environment:
            USE_ADDITIONAL_OPTIONS: --sa --log_config.global_log_options level,nocolor,time,line_num,function
        volumes:
            - ../../conf_files/gnb-cucp.sa.f1.quectel.conf:/opt/oai-gnb/etc/gnb.conf
        networks:
            public_net:
                ipv4_address: 192.168.68.194
        healthcheck:
            # pgrep does NOT work
            test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem"
            interval: 10s
            timeout: 5s
            retries: 5

    gnb_cuup:
        image: oai-nr-cuup:latest
        privileged: true
        container_name: sa-cuup-gnb
        environment:
            USE_ADDITIONAL_OPTIONS: --sa --log_config.global_log_options level,nocolor,time,line_num,function
        volumes:
            - ../../conf_files/gnb-cuup.sa.f1.quectel.conf:/opt/oai-gnb/etc/gnb.conf
        networks:
            public_net:
                ipv4_address: 192.168.68.196
        healthcheck:
            # pgrep does NOT work
            test: /bin/bash -c "ps aux | grep -v grep | grep -c nr-cuup"
            interval: 10s
            timeout: 5s
            retries: 5

    gnb_du_tdd:
        image: oai-gnb:latest
        privileged: true
        container_name: sa-du-b200-gnb
        environment:
            USE_B2XX: 'yes'
            USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx -E --log_config.global_log_options level,nocolor,time,line_num,function --gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 1 --RUs.[0].att_rx 18 --RUs.[0].att_tx 18
        volumes:
            - ../../conf_files/gnb-du.sa.band78.106prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf
            - /dev:/dev
        networks:
            public_net:
                ipv4_address: 192.168.68.195
        #entrypoint: /bin/bash -c "sleep infinity"
        healthcheck:
            # pgrep does NOT work
            test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem"
            interval: 10s
            timeout: 5s
            retries: 5

networks:
    public_net:
        name: sa-b200-gnb-net
        ipam:
            config:
                - subnet: 192.168.68.192/26
        driver_opts:
            com.docker.network.bridge.name: "sa-gnb-net"
