diff --git a/.env b/.env index b2e189a..420676b 100644 --- a/.env +++ b/.env @@ -80,4 +80,7 @@ UE1_OP=11111111111111111111111111111111 UE1_AMF=8000 # OAI ENB -OAI_ENB_IP=172.22.0.24 \ No newline at end of file +OAI_ENB_IP=172.22.0.24 + +# OPEN5GS WEBUI +WEBUI_IP=172.22.0.25 diff --git a/docker-compose.yaml b/docker-compose.yaml index 7a9fc05..a1635f9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -17,6 +17,25 @@ services: networks: default: ipv4_address: ${MONGO_IP} + webui: + build: ./webui + image: docker_open5gs_webui + container_name: webui + depends_on: + - mongo + env_file: + - .env + volumes: + - ./webui:/mnt/webui + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "3000/tcp" + ports: + - "3000:3000/tcp" + networks: + default: + ipv4_address: ${WEBUI_IP} nrf: build: ./nrf image: docker_open5gs_nrf @@ -108,8 +127,6 @@ services: - "5868/udp" - "5868/tcp" - "5868/sctp" - ports: - - "3000:3000/tcp" networks: default: ipv4_address: ${HSS_IP} diff --git a/hss/hss_init.sh b/hss/hss_init.sh index 095982f..0275a4d 100755 --- a/hss/hss_init.sh +++ b/hss/hss_init.sh @@ -28,7 +28,6 @@ export DB_URI="mongodb://${MONGO_IP}/open5gs" -cd webui && npm run dev & export IP_ADDR=$(awk 'END{print $1}' /etc/hosts) [ ${#MNC} == 3 ] && EPC_DOMAIN="epc.mnc${MNC}.mcc${MCC}.3gppnetwork.org" || EPC_DOMAIN="epc.mnc0${MNC}.mcc${MCC}.3gppnetwork.org" diff --git a/webui/Dockerfile b/webui/Dockerfile new file mode 100644 index 0000000..7eb9a50 --- /dev/null +++ b/webui/Dockerfile @@ -0,0 +1,29 @@ +# BSD 2-Clause License + +# Copyright (c) 2020, Supreeth Herle +# All rights reserved. + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: + +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. + +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +FROM docker_open5gs + +CMD sleep 10 && /mnt/webui/webui_init.sh diff --git a/webui/webui_init.sh b/webui/webui_init.sh new file mode 100755 index 0000000..0961a72 --- /dev/null +++ b/webui/webui_init.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# BSD 2-Clause License + +# Copyright (c) 2020, Supreeth Herle +# All rights reserved. + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: + +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. + +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +export DB_URI="mongodb://${MONGO_IP}/open5gs" + +cd webui && npm run dev + +# Sync docker time +#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone