This guide provides all the steps you need to deploy the application to the cloud. After following these steps, you'll be able to access the application from anywhere.
I've provided a Shell script to get a Debian-based virtual machine set up that greatly simplifies the steps you'll take. Before you run this, you'll need to meet all the prerequisites. Then, you can proceed to deploy the application.
Before you deploy the application to the internet, you need to acquire and set up all the following:
- A virtual machine instance running a Debian-based operating system, with root privileges
- A static IP address assigned to that virtual machine instance (not an ephemeral address)
- A hostname that you own, set up with DNS A records for this application
First, you'll need to rent a virtual machine from a cloud provider. Most cloud providers have an always free or free tier then pay-as-you-go tier.
For example, you could use any of the following services:
You can always set up your own machine to serve the application, for example, using a Raspberry Pi. The software setup is the same as the application is platform-independent; however, the exact steps are out of the scope of this guide.
To reliably serve the application over the internet, you'll want to acquire a static IP address (not an ephemeral address) and assign this to your virtual machine. Check your cloud provider's documentation on information on how to do this.
To route traffic from your domain name to your virtual machine, set up these DNS records:
Type Name Value TTL
A api.asana-hire <your VM's static IP address> <any value>
A asana-hire <your VM's static IP address> <any value>
You can replace asana-hire
with anything else in Name
, as long as your environment variables match. Here's an
example configuration:
CLIENT_BASE_URL=https://asana-hire.<your domain name and top level domain>
SERVER_BASE_URL=https://api.asana-hire.<your domain name and top level domain>
Finally, you may still need to configure your virtual machine's firewall. Check your cloud provider's documentation for more details.
First, SSH into your virtual machine and clone this repository:
git clone https://github.com/ConservationColorado/asana-hire.git
sudo asana-hire/scripts/setup-debian-vm.sh
This script will:
- Run updates on your virtual machine
- Install Docker
- Install and configure Nginx
- Install and configure an auto-renewing Let's Encrypt SSL certificate
Enter the directory where you cloned this repository and run the following docker
command in your terminal:
docker compose --env-file <path to your env file> up
You may optionally include the -d
flag to start the containers in the background of your terminal.