open5gs/docker/docker-compose.yml

124 lines
3.1 KiB
YAML

version: '3'
services:
mongodb:
image: mongo
container_name: open5gs-mongodb
ports:
- "27017:27017"
restart: unless-stopped
volumes:
- mongodb:/data/db
- ../docs/assets/webui/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
webui:
build:
context: ../
dockerfile: docker/webui/Dockerfile
image: ${USER}/open5gs-webui
container_name: open5gs-webui
depends_on:
- mongodb
ports:
- "9999:9999"
environment:
- DB_URI=mongodb://mongodb/open5gs
- WAIT_HOSTS=mongodb:27017
base:
build:
context: ./${DIST-ubuntu}/${TAG-latest}/base
args:
dist: ${DIST-ubuntu}
tag: ${TAG-latest}
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-base
command: /bin/bash -c "echo 'base' services"
build:
build:
context: ../
dockerfile: docker/build/Dockerfile
args:
dist: ${DIST-ubuntu}
tag: ${TAG-latest}
username: ${USER}
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-build
depends_on:
- base
command: /bin/bash -c "echo 'build' services"
run:
# network_mode: "host"
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-build
depends_on:
- mongodb
- build
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun:/dev/net/tun"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
volumes:
- config:/etc/open5gs
hostname: open5gs-run
# command: /bin/bash -c "/root/setup.sh; /usr/bin/open5gs-pcrfd -D; /usr/bin/open5gs-pgwd -D; /usr/bin/open5gs-sgwd -D; /usr/bin/open5gs-hssd -D; /usr/bin/open5gs-mmed"
test:
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-build
depends_on:
- mongodb
- build
environment:
- DB_URI=mongodb://mongodb/open5gs
- WAIT_HOSTS=mongodb:27017
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun:/dev/net/tun"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
hostname: open5gs-test
command: /bin/bash -c "/root/setup.sh; cd /open5gs/build && /wait && meson test -v"
dev:
build:
context: ./${DIST-ubuntu}/${TAG-latest}/dev
args:
dist: ${DIST-ubuntu}
tag: ${TAG-latest}
username: ${USER}
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-dev
depends_on:
- mongodb
- base
environment:
- DB_URI=mongodb://mongodb/open5gs
- DISPLAY=$DISPLAY
# - DISPLAY=host.docker.internal:0
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun:/dev/net/tun"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
volumes:
- home:/home/${USER}
- ${HOME}:/mnt
# - /tmp/.X11-unix:/tmp/.X11-unix
# - /etc/localtime:/etc/localtime:ro
# - /usr/share/zoneinfo/Europe/Helsinki:/etc/localtime:ro
hostname: open5gs-dev
user: ${USER}
entrypoint: /bin/bash -c "/bin/bash -c \"$${@}\""
command: |
/bin/bash -c "
sudo chmod 666 /dev/net/tun
sudo /root/setup.sh
/bin/bash || exit 0
"
volumes:
mongodb: {}
home: {}
config: {}