A containerised HTTPS Flask API
- #Data Management
Turnkey dockerised setup for an HTTPS Flask API with SSL certificates includedđź”—
I was wrapping things up for my freelance clients before holidays, and I had to migrate a dockerized flask API to HTTPS.
I knew how to do it with nginx + python on the server, but I researched a reproducible way to do it with nginx + docker.
Then I started pulling the thread and first creating a docker-compsoe setup for nginx + the flask API. But then you still need to manage your SSL certificates “manually” on the server with certbot.
I ended up with something pretty cool that I can reuse from now on: a docker-compose setup with certbot + nginx + flask, all in one.
Reusable Solutionđź”—
The following gist is made of 3 parts:
- a docker compose setup sith
nginx,certbotandflask - a setup shell script that manages the SSL certificates generation
- a nginx configuration supporting HTTPS
You will need to tweak the hardcoded values that point to my service startup-meter.louisguitton.com.
Nginx + HTTPS + Docker | GitHub Gist
Referencesđź”—
- Nginx and Let’s Encrypt with Docker in Less Than 5 Minutes | by Philipp | Medium
- How to setup your website for that sweet, sweet HTTPS with Docker, Nginx, and letsencrypt
Related posts
pg_service.conf: Named connection profiles for PostgreSQLPostgreSQL's pg_service.conf works like kubectl contexts: named profiles with tenant context baked in, so your coding agent never queries the wrong database.
- #Data Management
- #Artificial Intelligence
(non) Alternatives to dbtDuring this talk, I’ll be sharing tips to effectively “sell” dbt and the modern data stack, and insights on the current landscape of data transformation tools.
- #Data Management
- #Projects
Functional Programming for Pandas Data EngineeringApply functional programming to pandas data engineering: method chaining, efficient row operations, and pipeline code that stays easy to maintain.
- #Data Management
