docker-compose.yml 8.09 KB
Newer Older
Rohan's avatar
Rohan committed
1
2
3
version: '3.8'
services:
    mysql:
Rohan's avatar
Rohan committed
4
        container_name: "mysql"
foo's avatar
foo committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
        image: mysql:5.7
        volumes:
            - ./oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
            - ./mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
        environment:
            - TZ=Europe/Paris
            - MYSQL_DATABASE=oai_db
            - MYSQL_USER=test
            - MYSQL_PASSWORD=test
            - MYSQL_ROOT_PASSWORD=linux
        healthcheck:
            test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
            interval: 10s
            timeout: 5s
            retries: 5
Rohan's avatar
Rohan committed
20
        networks:
Rohan's avatar
Rohan committed
21
22
23
24
25
            public_net_core:
                ipv4_address: 192.168.71.131
    oai-nrf:
        container_name: "oai-nrf"
        image: oai-nrf:latest
Rohan's avatar
Rohan committed
26
        environment:
Rohan's avatar
Rohan committed
27
28
29
30
31
32
33
34
35
36
37
            - NRF_INTERFACE_NAME_FOR_SBI=eth0
            - NRF_INTERFACE_PORT_FOR_SBI=80
            - NRF_INTERFACE_HTTP2_PORT_FOR_SBI=8080
            - NRF_API_VERSION=v1
            - INSTANCE=0
            - PID_DIRECTORY=/var/run
        networks:
            public_net_core:
                ipv4_address: 192.168.71.130
        volumes:
            - ./nrf-healthcheck.sh:/openair-nrf/bin/nrf-healthcheck.sh
Rohan's avatar
Rohan committed
38
        healthcheck:
Rohan's avatar
Rohan committed
39
            test: /bin/bash -c "/openair-nrf/bin/nrf-healthcheck.sh"
Rohan's avatar
Rohan committed
40
41
42
            interval: 10s
            timeout: 5s
            retries: 5
Rohan's avatar
Rohan committed
43
    oai-amf:
Rohan's avatar
Rohan committed
44
45
        container_name: "oai-amf"
        image: oai-amf:latest
Rohan's avatar
Rohan committed
46
        environment:
Rohan's avatar
Rohan committed
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
            - TZ=Europe/paris
            - INSTANCE=0
            - PID_DIRECTORY=/var/run
            - MCC=208
            - MNC=95
            - REGION_ID=128
            - AMF_SET_ID=1
            - SERVED_GUAMI_MCC_0=208
            - SERVED_GUAMI_MNC_0=95
            - SERVED_GUAMI_REGION_ID_0=128
            - SERVED_GUAMI_AMF_SET_ID_0=1
            - SERVED_GUAMI_MCC_1=460
            - SERVED_GUAMI_MNC_1=11
            - SERVED_GUAMI_REGION_ID_1=10
            - SERVED_GUAMI_AMF_SET_ID_1=1
            - PLMN_SUPPORT_MCC=208
            - PLMN_SUPPORT_MNC=95
            - PLMN_SUPPORT_TAC=0xa000
            - SST_0=222
            - SD_0=123
            - SST_1=1
            - SD_1=12
            - AMF_INTERFACE_NAME_FOR_NGAP=eth0
            - AMF_INTERFACE_NAME_FOR_N11=eth0
            - SMF_INSTANCE_ID_0=1
            - SMF_FQDN_0=oai-smf
            - SMF_IPV4_ADDR_0=192.168.71.133
            - SMF_HTTP_VERSION_0=v1
            - SMF_INSTANCE_ID_1=2
            - SMF_FQDN_1=oai-smf
            - SMF_IPV4_ADDR_1=0.0.0.0
            - SMF_HTTP_VERSION_1=v1
            - MYSQL_SERVER=192.168.71.131
            - MYSQL_USER=root
            - MYSQL_PASS=linux
            - MYSQL_DB=oai_db
            - OPERATOR_KEY=63bfa50ee6523365ff14c1f45f88737d
            - NRF_IPV4_ADDRESS=0.0.0.0
            - NRF_PORT=80
            - NF_REGISTRATION=no
            - SMF_SELECTION=no
            - USE_FQDN_DNS=no 
            - NRF_FQDN=oai-nrf
            - NRF_API_VERSION=v1
            - AUSF_IPV4_ADDRESS=127.0.0.1
            - AUSF_PORT=80
            - AUSF_API_VERSION=v1
        depends_on:
            - mysql
            - vpp-upf
            - oai-ext-dn
        volumes:
            - ./amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh
Rohan's avatar
Rohan committed
100
        healthcheck:
Rohan's avatar
Rohan committed
101
            test: /bin/bash -c "/openair-amf/bin/amf-healthcheck.sh"
Rohan's avatar
Rohan committed
102
            interval: 10s
Rohan's avatar
Rohan committed
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
            timeout: 15s
            retries: 5
        networks:
            public_net_core:
                ipv4_address: 192.168.71.132
    oai-smf:
        container_name: "oai-smf"
        image: oai-smf:latest
        environment:
            - TZ=Europe/Paris
            - INSTANCE=0
            - PID_DIRECTORY=/var/run
            - SMF_INTERFACE_NAME_FOR_N4=eth0
            - SMF_INTERFACE_NAME_FOR_SBI=eth0
            - SMF_INTERFACE_PORT_FOR_SBI=80
            - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
            - SMF_API_VERSION=v1
            - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129
            - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8
            - AMF_FQDN=oai-amf
            - AMF_IPV4_ADDRESS=192.168.71.132
            - AMF_PORT=80
            - AMF_API_VERSION=v1
            - UDM_IPV4_ADDRESS=127.0.0.1
            - UDM_FQDN=localhost
            - UDM_PORT=80
            - UDM_API_VERSION=v1
            - UPF_FQDN_0=gw1.vppupf.node.5gcn.mnc95.mcc208.3gppnetwork.org
            - UPF_IPV4_ADDRESS=192.168.71.202
            - NRF_FQDN=oai-nrf
            - NRF_IPV4_ADDRESS=0.0.0.0
            - NRF_PORT=80
            - NRF_API_VERSION=v1
            - REGISTER_NRF=no
            - DISCOVER_UPF=no
            - USE_NETWORK_INSTANCE=yes
            - USE_FQDN_DNS=no
        extra_hosts:
            - "gw1.vppupf.node.5gcn.mnc95.mcc208.3gppnetwork.org:192.168.71.202"
        depends_on:
            - oai-amf
        volumes:
             - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh
             - /home/rohan/gitrepo/oai-cn5g-smf:/oai-cn5g-smf
        healthcheck:
             test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh"
             interval: 10s
             timeout: 5s
             retries: 5
        networks:
            public_net_core:
                ipv4_address: 192.168.71.133
        entrypoint: /bin/bash -c "sleep infinity"
    vpp-upf:
        image: vpp-upg:latest
Rohan's avatar
Rohan committed
158
        privileged: true
Rohan's avatar
Rohan committed
159
        container_name: vpp-upf
Rohan's avatar
Rohan committed
160
        environment:
Rohan's avatar
Rohan committed
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
            - NWI_CORE=core.oai.org
            - NWI_ACCESS=access.oai.org
            - NWI_SGI=sgi.oai.org
            - GW_ID=1
            - MNC03=95
            - MCC=208
            - REALM=3gppnetwork.org
            - NETWORK_UE_IP=12.1.1.0/24
            - N3_IPV4_ADDRESS_REMOTE=192.168.72.141
            - N3_IPV4_ADDRESS_LOCAL=192.168.72.202
            - N4_IPV4_ADDRESS_REMOTE=192.168.71.133
            - N4_IPV4_ADDRESS_LOCAL=192.168.71.202            
            - N6_IPV4_ADDRESS_REMOTE=192.168.73.135
            - N6_IPV4_ADDRESS_LOCAL=192.168.73.202
            - VPP_MAIN_CORE=0
            - VPP_CORE_WORKER=1
#           - VPP_PLUGIN_PATH=/usr/lib64/vpp_plugins/                # RHEL7
            - VPP_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/vpp_plugins/ # Ubntu18.04
            - INTERFACE_ACCESS=eth0
            - INTERFACE_CORE=eth1
            - INTERFACE_SGI=eth2
            - NSSAI_SD_0=222
            - SST=123
            - DNN=default
            - REGISTER_NRF=yes
            - NRF_IP_ADDR=192.168.71.130
            - NRF_PORT=8080
            - HTTP_VERSION=2
Rohan's avatar
Rohan committed
189
190
191
192
        healthcheck:
            test: /bin/bash -c "pgrep vpp"
            interval: 10s
            timeout: 5s
Rohan's avatar
Rohan committed
193
            retries: 5
Rohan's avatar
Rohan committed
194
        networks:
Rohan's avatar
Rohan committed
195
196
197
198
            public_net_core:
                ipv4_address: 192.168.71.134
            public_net_access:
                ipv4_address: 192.168.72.134
Rohan's avatar
Rohan committed
199
            public_net_sgi_lan:
Rohan's avatar
Rohan committed
200
                ipv4_address: 192.168.73.134
Rohan's avatar
Rohan committed
201
        #entrypoint: /bin/bash -c "sleep infinity"
Rohan's avatar
Rohan committed
202
203
204
205
    oai-ext-dn:
        image: ubuntu:bionic
        privileged: true
        container_name: oai-ext-dn
Rohan's avatar
Rohan committed
206
        entrypoint: /bin/bash -c \
Rohan's avatar
Rohan committed
207
              "apt update; apt install -y iptables iproute2 iputils-ping;"\
Rohan's avatar
Rohan committed
208
              "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
Rohan's avatar
Rohan committed
209
210
211
212
              "ip route add 12.1.1.0/24 via 192.168.73.202 dev eth0; sleep infinity"
        command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"]
        depends_on:
            - vpp-upf
Rohan's avatar
Rohan committed
213
        networks:
Rohan's avatar
Rohan committed
214
215
            public_net_sgi_lan:
                ipv4_address: 192.168.73.135
Rohan's avatar
Rohan committed
216
networks:
Rohan's avatar
Rohan committed
217
218
    public_net_core:
        name: oai-public-core
Rohan's avatar
Rohan committed
219
220
        ipam:
            config:
Rohan's avatar
Rohan committed
221
                - subnet: 192.168.71.0/24
Rohan's avatar
Rohan committed
222
223
224
225
    public_net_access:
        name: oai-public-access
        ipam:
            config:
Rohan's avatar
Rohan committed
226
                - subnet: 192.168.72.0/24
Rohan's avatar
Rohan committed
227
228
229
230
    public_net_sgi_lan:
        name: oai-public-sgi-lan
        ipam:
            config:
Rohan's avatar
Rohan committed
231
232
233
234
235
236
237
238
239
240
241
242
                - subnet: 192.168.73.0/24
        
    
# Incase the user wants docker-compose to create a bridge rather than creating the bridge manually then uncomment the below lines
#     public_net:
#         driver: bridge
#         name: demo-oai-public-net
#         ipam:
#             config:
#                 - subnet: 192.168.71.128/26
#         driver_opts:
#             com.docker.network.bridge.name: "demo-oai"