What I want to do Expose an Flask API via Droplet over HTTPS.
What I’ve done
Questions
Thank you in advance.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hello @billygenerativelabs
You can secure the traffic with the Let’s Encrypt’s SSL Certificate with no issues, usually, this is what they’re mostly used for in general.
The certificate files should be stored in
/etc/letsencrypt/
and you can inspect them at any time.You can also set up a cronjob to auto-renew the certificate.
Regards
Thank you both.
@Richard: Yes, I noticed the documentation indicated that certificates can be used with load balancers, easy enough, but given that I’m not using a load balancer at this point (as the traffic doesn’t warrant it), I was looking to know if I could use those same certificates to secure an HTTP server directly.
@KFSys: Interesting, I will look. I ended up running CERTBOT directly on the Droplet server, mounted the directory containing the cert into my container, and then referenced them in Dockerfile’s Gunicorn run command. It ended up working great, but was a little more work than expected.
I have services running the way you describe:
(Want more help? Just ask.)