Closed dlcrista closed 4 years ago
Sorry for the delay! I was busy building FastAPI.
The suggested way to have HTTPS is using Traefik, it can acquire free Let's Encrypt certificates (including renewals).
You can set up a Docker Swarm mode cluster with Traefik for HTTPS in about 20 min.
And then you can use one of the project generators that have everything set up to be integrated into the cluster. I just added information on that to the docs: https://github.com/tiangolo/uwsgi-nginx-flask-docker#project-generators
Thanks!
Btw, have this ever happened to you?
WARN received SIGTERM indicating exit request
and then uwsgi and nginx stops. I'm not sure what is sending the sigterm
Hmm, where do you see that? In the logs?
Are you sure Nginx stops too? Or is it only uwsgi
?
I just finished a big refactor to allow creating a file /app/nginx.conf
. In it, you could add any custom configurations you need, including a custom TLS certificate.
The docs are here: https://github.com/tiangolo/uwsgi-nginx-flask-docker#overriding-nginx-configuration-completely
I still suggest you use Traefik for HTTPS, but in case you definitely need to customize it, there's the option now.
BTW, I created DockerSwarm.rocks to document how to set everything up.
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.
Assuming that I'm using the file structure from example-flask-python3.7-index, how should I edit the nginx.conf file to accept an ssl certificate and a private key and serve flask over https?