services-xbee_net/docker-compose-run-multiple...

39 lines
789 B
YAML
Raw Normal View History

version: '3.8'
services:
xbnet0:
build: .
container_name: xbnet0
privileged: true
env_file:
- .env
devices:
- "${XBEE0_PORT}:${XBEE0_PORT}"
command: >
bash -c "
set -x;
xbnet ${XBEE0_PORT} tun;
ip addr add ${XBEE0_NET_IP}/24 dev xbnet0;
ip link set dev xbnet0 up;
ping -c 4 ${PING0_TARGET};
sleep infinity
"
xbnet1:
build: .
container_name: xbnet1
privileged: true
env_file:
- .env
devices:
- "${XBEE1_PORT}:${XBEE1_PORT}"
command: >
bash -c "
set -x;
xbnet ${XBEE1_PORT} tun;
ip addr add ${XBEE1_NET_IP}/24 dev xbnet1;
ip link set dev xbnet1 up;
ping -c 4 ${PING1_TARGET};
sleep infinity
"