Simple Web App
In this part we will be deploying a simple full-stack web app to an EC2 instance. The app will connect to a MySQL database and use a caddy reverse proxy to serve traffic. This will all be setup on a single EC2 instance.
Here's an example of exactly what we'll be doing:
The app you will be deploying is a basic bun server, not a node server, but the process is the same. It is a simple QR code generator that stores the data in a MySQL database.
Setup Instance
Once the instance is created, login to the instance using ssh. We're now going to install MySQL on the instance and setup a new database.
MySQL
That's all we need to do to setup the database for the web app. It will need to connect to the database using the following MySQL connection string environment variable: