Architecture of This Site
A look under the hood at how this portfolio is built and deployed.
Overview
I built this portfolio the same way I build production systems. Flask handles the routing. Docker packages it up. Nginx sits in front and handles SSL. The whole thing runs on a single Lightsail instance for about five dollars a month.
Infrastructure
Hosting
AWS Lightsail
Container
Docker
Web Server
Nginx (reverse proxy)
App Server
Gunicorn
SSL
Let's Encrypt (Certbot)
DNS
AWS Lightsail DNS
Application Stack
Framework
Flask
Language
Python 3.9
Templating
Jinja2
Data Store
JSON file
Styling
Custom CSS
Icons
Font Awesome
Deployment
Method
Shell script (deploy.sh)
Transfer
rsync over SSH
Build
Docker build on server
Restart
Zero-downtime container swap
Request Flow
Browser
Nginx + SSL
Docker
Flask App
Why This Stack?
I pick the right tool for the job. This site doesn't need Kubernetes or a managed database. It's a portfolio that changes a few times a year. A single Lightsail instance with Docker gives me everything I need:
- Low cost at about $5/month for the smallest instance
- Fast deploys with one command to push changes
- Easy debugging since I can SSH in and check logs directly
- Full control with no vendor lock-in or abstractions
- Multi-site hosting so the same instance hosts multiple domains via Nginx