Log into the new server. We only need to install Docker and create a folder for the configuration, not the data (Docker handles data now).
Update and install
sudo apt-get update
sudo apt-get install -y docker.io docker-compose-plugin
Enable on boot
sudo systemctl enable --now docker
We only need a place to put the docker-compose.yml file
sudo mkdir -p /opt/net-assure
sudo chmod 777 /opt/net-assure
Create the production definition.
File: /opt/net-assure/docker-compose.yml
services:
backend:
image: mmnahamed/net-assure-backend:latest
container_name: netassure-backend
restart: unless-stopped
ports:
- "8000:8000"
environment:
- DATABASE_URL=sqlite:////app/data/net_assure.db
- GIT_REPO_PATH=/app/network_configs_repo
- BATFISH_HOST=batfish
volumes:
- netassure_data:/app/data
- netassure_repo:/app/network_configs_repo
- netassure_reports:/app/reports
- ~/.gitconfig:/root/.gitconfig:ro
depends_on:
- batfish
batfish:
image: batfish/batfish:latest
restart: unless-stopped
volumes:
- batfish_data:/data
volumes:
netassure_data:
netassure_repo:
netassure_reports:
batfish_data:
Run this on the New Server:
cd /opt/net-assure
sudo docker compose up -d
sudo docker compose logs -f backend
Expected Log Output: You should see lines like: [+] Creating Data Directory: /app/data [+] Verifying Database Schema... [+] Initializing Network Configs Repo... Next Step: Once you see
Uvicorn running on http://0.0.0.0:8000
your server is live. Access the API docs at http://<NEW_SERVER_IP>:8000/docs.
Content type
Image
Digest
sha256:e1d6fdfb3…
Size
343.9 MB
Last updated
6 months ago
docker pull mmnahamed/net-assure-backend