5.9 KiB
The BRECcIA Network Mapper can be deployed in a variety of ways, most of which utilise Docker. Ansible deployment has been tested on RHEL7 and RHEL8.
Ansible
Prerequisites:
:::{note}
Deployment with Ansible has been tested on RHEL7 and RHEL8, but is compatible with other Linux distributions with minor changes to the playbook (deploy/playbook.yml)
:::
To deploy the BRECcIA Network Mapper with Ansible:
-
Download and extract the deployment files from the latest release:
curl https://github.com/Southampton-RSG/breccia-mapper/releases/latest/download/deploy-ansible.tar | tar xzv && cd deploy-ansible -
Copy your logo (192x192 pixels) to
icon-192x192.pngin this folder. -
Copy
example.envto.env:cp example.env .env -
Edit this file as desired. Note that some variables are required.
-
Copy
inventory.example.ymltoinventory.yml:cp inventory.example.yml inventory.yml -
Edit this file to reflect your Ansible setup:
- Use your server's hostname instead of
example.com
- If you would like a new superuser to be provisioned (e.g. during initial install), edit the
provision_superuservariable inplaybook.ymltotrue.
- Then change the
superuser_*options below it as desired.
-
Run the Ansible playbook
playbook.ymlwith this inventory file using:ansible-playbook playbook.yml -i inventory.yml -K -k -u <SSH username>
This will ask for your SSH and sudo passwords for the server before deploying. To redeploy updates, the same command can be run again - it's safe to redeploy on top of an existing deployment.
:::{warning}
If you changed the provision_superuser variable in playbook.yml to true, remember to change it back to false.
:::
Docker Compose
Prerequisites:
- Docker Compose (installed by default with most Docker installs)
:::{note} Deployment with Docker has been tested on RHEL7, RHEL8, and Ubuntu 22.04 LTS :::
To deploy the BRECcIA Network Mapper with Docker:
-
Download and extract the deployment files from the latest release:
curl https://github.com/mgrove36/Southampton-RSG/releases/latest/download/deploy-docker.tar | tar xzv && cd deploy-docker -
Copy your logo (192x192 pixels) to
icon-192x192.pngin this folder. -
Copy
example.envto.env:cp example.env .env -
Edit this file as desired. Note that some variables are required.
-
Create the database using:
touch db.sqlite3 -
Start the containers with the following command (you may need to use
sudo):docker compose up -d -
If desired (e.g. on initial deployment), create a superuser by running the following, and enter their details when prompted:
docker compose exec -it server /bin/bash -c "/app/manage.py createsuperuser"
:::{important} If you don't create a superuser when you first deploy the app, you will be unable to log in. :::
Vagrant
Prerequisites:
To deploy the BRECcIA Network Mapper with Vagrant:
-
Download and extract the deployment files from the latest release:
curl https://github.com/mgrove36/Southampton-RSG/releases/latest/download/deploy-vagrant.tar | tar xzv && cd deploy-vagrant -
Copy your logo (192x192 pixels) to
icon-192x192.pngin this folder. -
Copy
example.envto.env:cp example.env .env -
Edit this file as desired. Note that some variables are required.
-
If you would like a new superuser to be provisioned (e.g. during initial install), edit the
provision_superuservariable inplaybook.ymltotrue.
- Then change the
superuser_*options below it as desired.
- To change where the app is accessible from, edit the
config.vm.networkline inVagrantfile.
- By default, the app is accessible only from
http://localhost:8080. - To make it available from any IP address, replace
host: 8080, host_ip: "127.0.0.1"withhost: 8080. - To change the port the app is available on, edit
host: 8080. - More details are available in the Vagrant docs.
-
Start the virtual machine:
vagrant up -
Deploy the Network Mapper on the virtual machine:
vagrant provision
:::{note}
To stop the virtual machine, run vagrant halt in this directory. More commands are explained in the Vagrant docs.
:::