shahidhk / tw-front-back

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tw-front-back

This is the repo for Toronto Water's Structured Asset Management System's Backend

First Time Running the Server:

  1. Prerequisite

    • Set up a Ubuntu 18.04 LTS vm
    • Create a duckdns account and get your account token
    • Set your token as an environmental variable by running

    export DUCKDNS=90baa534-42be-41e3-975b-4a3b5a1b21d1

    • Create an entry in Duckdns linking the ip address of the VM with the subdomain (tw-webapp)
  2. Install Docker + Docker Compose

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
  1. Clone the repo

git clone https://github.com/CityofToronto/tw-front-back.git

  1. Go into repo directory

cd tw-front-back

  1. Start the server via docker-compose

sudo docker-compose up -d

  1. Replace the default nginx config file

sudo cp /home/YOURUSERNAME/tw-front-back/nginx/nginx.conf.template /home/appdata/letsencrypt/nginx/site-confs/default

  1. Restart nginx to reload the new config

sudo docker-compose restart nginx

  1. Initialize the database and configure hasura by visiting:

https://django.tw-webapp.duckdns.org/djangoAPI/init-all

  1. Retrive the latest web client release by visiting:

https://django.tw-webapp.duckdns.org/djangoAPI/update-app

  1. Optional: A specific release of the web client can be retrived by specifying the release tag

https://django.tw-webapp.duckdns.org/djangoAPI/get-app?tag=2019.11.07-18.27.313213

Updating The Server

  1. git pull
  2. sudo docker-compose restart

Reseting the Server

  1. sudo docker-compose down -v
  2. sudo docker-compose up -d

Remove all Docker files sudo docker system prune -a

About


Languages

Language:Python 66.4%Language:JavaScript 20.1%Language:PLpgSQL 5.5%Language:Shell 3.1%Language:HTML 3.0%Language:CSS 1.2%Language:Visual Basic .NET 0.3%Language:PowerShell 0.3%Language:Dockerfile 0.2%