Production Deployment

Instructions on how to deploy each of our projects to our AWS instance.

Before getting started with production deployment, please read over Cloud to get an overview of our cloud/production architecture.

Manual Deployment

Frontend

Deploying the frontends to production is relatively simple since they are just static websites served by Caddy. To deploy a site, build the site, then copy the files to the respectively directory on the AWS EC2 instance where they are being served from.

Make sure you also build all the packages that the site uses.

npm run packages:build
Example: deploy client site
cd client
npm run build
scp -r dist/* user@host:destination

Caddy should automatically handle new requests and serve from these files.

Backend

Deploying the backend follows a similar process. First, build the Docker image, then save it into a file, send the file to the AWS EC2 instance, load the image, then rerun the Docker compose stack.

npm run docker:build
docker save -o edroplets_backend.tar edroplets_backend
scp edroplets_backend.tar user@host:destination

The above commands send the image file to our production server. Then you may SSH into the server and run the following commands.

// Some code

Automatic Deployment

There are GitHub Actions intended to run a deployment off a given branch. Go to the Actions tab in the repository to run a GitHub Action. You may (and should) read through the action workflows in the .github/workflows folder.

Last updated