Question

How to setup a Flask app using Docker as a standalone website

Posted December 4, 2020 2.5k views
NginxDockerUbuntu 18.04Flask

Hello,

I’m reaching out with respect to a problem I had earlier and am now taking a new simpler approach. I have a dockerized Flask app that I want as a standalone web page.

I followed this great guide here to spin up a droplet with a Flask app on it through Docker.

https://www.digitalocean.com/community/tutorials/how-to-build-and-deploy-a-flask-application-using-docker-on-ubuntu-18-04#step-1-%E2%80%94-setting-up-the-flask-application

I want to essentially do this and have it be a subdomain of a site I already own. Say my site is mysite.us and I want this droplet to be @ demo.mysite.us

How would I go about setting that up? Thanks!

1 comment

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.

×
Submit an Answer
1 answer

Hi there @frankieguz,

Yes indeed, it should be enough to point your domain name to the Droplet’s IP address in order to get it pointed to your Flask application.

In case you wanted to add an SSL certificate, then you could use Nginx as a reverse proxy to handle the SSL termination, or use Cloudflare with Flexible SSL instead.

Regards,
Bobby