Deployment Plan - sarayu-pr11/team-narks GitHub Wiki

Deployment Plan

  • Hardware: Ordered CanaKit Raspberry Pi 4 for the deployment process
  • download VNC viewer so you can access the Raspberry Pi anywhere
  • use terminal to set up Github environment on deployment host - make sure clone and cd name match repository
  • verify virtual environment and set up PIP packages to run the Web Application - needs requirements.txt
  • install and use terminal to test Gunicorn in browser - now the virtual environment is ready
  • create Gunicorn and Nginx configuration files to run Web Application as a service - validate these files to enable permanent services
  • visit freenom.com to register public IP address to a domain
  • use certbot to ensure Web Application is secure

Frequency/Release Day Policies

  • Any updates/commits to the deployed website will need to be added using the terminal
  • Website should be updated at least once a week, but twice a week is ideal
  • All commits should be done and pushed to the website the evening before the deadline
  • Backup Deployment Managers in order: Riya, Sarayu, Natalie, Abigail
  • Order of commits to deployed website: Kamryn, Riya, Sarayu, Natalie, Abigail
  • In order to update, open a new terminal in VNC viewer and cd to github repo, "team-narks". Then, use the command "git pull" to get the latest changes on the deployed website.
  • team-narks$ source homesite/bin/activate
  • pip install -r requirements.txt
  • sudo systemctl restart homesite.service

NGINX configuration file server{ listen 443 ssl; listen [::]:443 ssl; server_name studycalm.ddns.net;

ssl_certificate /etc/letsencrypt/live/studycalm.ddns.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/studycalm.ddns.net/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

location / { include proxy_params; proxy_pass http://unix:/home/pi/team-narks/studyhall.sock; } }

Service file

[Unit] Description=Gunicorn instance to serve homesite web project After=network.target [Service] User=pi Group=www-data WorkingDirectory=/home/pi/team-narks Environment="PATH=/home/pi/team-narks/studyhall/bin" ExecStart=/home/pi/team-narks/studyhall/bin/gunicorn --workers 3 --bind unix:studyhall.sock -m 007 main>

[Install] WantedBy=multi-user.target

Domain: https://studycalm.ddns.net:5000