PikaCourse / homiehomie

3 stars 0 forks source link

Current server deployment setting #102

Open William-An opened 3 years ago

William-An commented 3 years ago

Deployment setting for CourseOcean

Development

  1. Project is running at @William-An 's server on dokku at URL: test-homie
  2. The deployment process is as follow:
    1. Contributor push a commit to dev branch which contains [deploy] in commit message
    2. Trigger GitHub Actions to run test for frontend and backend code
      1. Frontend
        1. This job will build and test the react frontend under node 14.x
        2. After the build, the built main.js will be copied to remote test server
      2. Backend
        1. This job will run coverage tests against the backend django code and upload report to codecov
        2. Will be run against python 3.7 and 3.8
      3. Deployment
        1. If both above jobs succeed, a deployment to test server will be triggered
        2. The build process only use heroku python buildpack
        3. After the build, the predeploy script will copy the frontend code from the persistent storage folder to the app container folder
        4. The script will then run database migration and collect static files together for serving
        5. The server will then run

Production

Computation

A basic droplet hosted on digitalocean:

  1. 1 vCPU
  2. 1 GB RAM

The deployment process is the same as the development deployment process except the deployment will be triggered on main branch

Mailing

A postfix service is running on the same droplet that host the website for dealing with email sending service like password reset and email verification. A weekly report will be sent to @William-An email for monitoring followed by the instruction here

We now use mailgun as our email service provider.

Database

A PostgreSQL database hosted on digitalocean with:

  1. 1 vCPU
  2. 1 GB RAM

Domain and DNS

Currently, we have two domains:

  1. courseocean.cc
  2. courseocean.us

Which are both under godaddy with nameservers pointed to cloudflare, which enable some DDos protection and CDN