diff --git a/docker-compose-exabgpremote.yml b/docker-compose-exabgpremote.yml new file mode 100644 index 0000000000000000000000000000000000000000..9d6200533935ec9e9b45792c4a5bd7884510f57f --- /dev/null +++ b/docker-compose-exabgpremote.yml @@ -0,0 +1,188 @@ +version: "3" +services: + fod: + image: flowspydjango + #command: /opt/FOD/pythonenv gunicorn -b 0.0.0.0:8000 flowspy.wsgi -w 10 -k gevent --limit-request-fields 10000 --timeout 30 --graceful-timeout 25 + command: sh -c '. ./docker-compose/.env_fod-exabgpremote; exec /opt/FOD/pythonenv ./manage.py runserver 0.0.0.0:8000' + container_name: fod + depends_on: + - celery + + privileged: true + expose: + - "8000" + ports: + - "0.0.0.0:8000:8000" + env_file: + - ./docker-compose/.env_fod-exabgpremote + networks: + mgmt: + xfod: + ipv4_address: 10.197.36.2 + volumes: + - ./:/opt/FOD + + celery: + build: + context: . + dockerfile: docker-compose/Dockerfile_FOD + image: flowspydjango + command: sh -c '. ./docker-compose/.env_fod-exabgpremote; /opt/setup_environment.sh && while ! mysqladmin -h db ping; do echo "DB not yet ready, waiting 1 sec"; sleep 1; done && echo "database is ready" && /opt/FOD/pythonenv ./manage.py migrate && exec /opt/FOD/pythonenv ./manage.py celery_worker' + container_name: celeryfod + depends_on: + - db + privileged: true + env_file: + - ./docker-compose/.env_fod-exabgpremote + networks: + mgmt: + xfod: + ipv4_address: 10.197.36.6 + volumes: + - ./:/opt/FOD + healthcheck: + test: /opt/FOD/pythonenv celery -b redis://redis/0 inspect ping + interval: 30s + timeout: 20s + retries: 3 + #start_period: 30s + + exabgp1: + build: + context: ./exabgp-remote + image: fodexabgp + container_name: fodexabgp + networks: + mgmt: + xfod: + ipv4_address: 10.197.36.8 + environment: + FOD_API_URL: "http://fod:8000/api" + FOD_API_TOKEN: "deb3252a1435302dd579448b792ee7fae57641b6" + LOCAL_NODEID: "10.197.36.8" + LOCAL_IP: "10.197.36.8" + LOCAL_ASN: "1001" + REMOTE_NODEID: "10.197.36.3" + REMOTE_IP: "10.197.36.3" + REMOTE_ASN: "2001" + volumes: + - ./exabgp-remote:/opt/exabgp + command: sh -c "pwd; ls; supervisord -c ./fod_exabgp_supervisord.conf" + + redis: + image: redis:latest + networks: + mgmt: + xfod: + ipv4_address: 10.197.36.5 + + db: + image: mariadb:latest + networks: + mgmt: + xfod: + ipv4_address: 10.197.36.7 + environment: + - MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=yes + - MARIADB_DATABASE=fod + volumes: + - db-data:/var/lib/mysql + healthcheck: + test: ["CMD-SHELL", 'mysqladmin ping'] + interval: 10s + timeout: 2s + retries: 10 + + + freertr: + build: + context: docker-compose + dockerfile: Dockerfile_FREERTR + container_name: freertr + privileged: true + expose: + - "23" + ports: + - "127.0.0.1:2323:2323" + env_file: + - ./docker-compose/.env_freertr + networks: + mgmt: + nhost1: + ipv4_address: 10.1.10.3 + nhost2: + ipv4_address: 10.2.10.3 + xfod: + ipv4_address: 10.197.36.3 + depends_on: + - fod + volumes: + - freertr:/opt + - ./freertr/run:/rtr/run/ + + host1: + build: + context: docker-compose + dockerfile: Dockerfile_HOST1 + container_name: host1 + privileged: true + env_file: + - ./docker-compose/.env_host1 + networks: + mgmt: + nhost1: + ipv4_address: 10.1.10.11 + depends_on: + - fod + #volumes: + # - freertr:/opt + + host2: + build: + context: docker-compose + dockerfile: Dockerfile_HOST2 + container_name: host2 + privileged: true + env_file: + - ./docker-compose/.env_host2 + networks: + mgmt: + nhost2: + ipv4_address: 10.2.10.12 + depends_on: + - fod + #volumes: + # - freertr:/opt + +networks: + mgmt: + driver: bridge + ipam: + driver: default + config: + - subnet: 11.11.11.0/24 + + xfod: + driver: bridge + ipam: + driver: default + config: + - subnet: 10.197.36.0/28 + + nhost1: + driver: bridge + ipam: + driver: default + config: + - subnet: 10.1.10.0/24 + + nhost2: + driver: bridge + ipam: + driver: default + config: + - subnet: 10.2.10.0/24 + +volumes: + freertr: + db-data: diff --git a/docker-compose/.env_fod-exabgpremote b/docker-compose/.env_fod-exabgpremote new file mode 100644 index 0000000000000000000000000000000000000000..e51d45420a5021e64b0ce5974d5d88f40625ebe9 --- /dev/null +++ b/docker-compose/.env_fod-exabgpremote @@ -0,0 +1,23 @@ +ADMIN_PASS=adminpwd +ADMIN_EMAIL=admin@localhost.local +FOD_ORG=testpeer +FOD_ORG_NET=0.0.0.0/0 +FOD_EXABGP_LOCAL_ID=10.197.36.2 +FOD_EXABGP_LOCAL_IP=10.197.36.2 +FOD_EXABGP_LOCAL_AS=1001 +FOD_EXABGP_REMOTE_ID=10.197.36.3 +FOD_EXABGP_REMOTE_IP=10.197.36.3 +FOD_EXABGP_REMOTE_AS=2001 +FOD_TESTRULE1_NAME_PREFIX=testrtr1 +FOD_TESTRULE1_SOURCE_IP_PREFIX=10.1.10.11/32 +FOD_TESTRULE1_DESTINATION_IP_PREFIX=10.2.10.12/32 +FOD_TESTRULE1_DESTINATION_IP_PROTOCOL=1 +FOD_REDIS_HOST=redis +FOD_DB_ENG=mysql +FOD_DB_NAME=fod +FOD_DB_USER=root +FOD_DB_PASS= +FOD_DB_HOST=db +FOD_DB_PORT= +FOD_EXABGP_NOTIFY=http://exabgp1:5000/ +FOD_PROXY_CLASS=proxy_exabgp_remote