Sign inSign up

mmnahamed/net-assure-backend

By mmnahamed

•Updated 6 months ago

Image
0

1.6K

mmnahamed/net-assure-backend repository overview

⁠Prepare the Target Server (The New Linux Box)

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).

⁠1. Install Docker & Compose

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

⁠2. Create Deployment Directory

We only need a place to put the docker-compose.yml file

sudo mkdir -p /opt/net-assure
sudo chmod 777 /opt/net-assure

⁠Deploy on Target Server

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:

⁠Go Live

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.

Tag summary

Content type

Image

Digest

sha256:e1d6fdfb3…

Size

343.9 MB

Last updated

6 months ago

docker pull mmnahamed/net-assure-backend