whythawk / full-stack-fastapi-postgresql

Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Nuxt3, Docker, automatic HTTPS and more.
MIT License
238 stars 48 forks source link

No Let's Encrypt Certificate for base domain #43

Closed an-mu closed 10 months ago

an-mu commented 10 months ago

Firstly, thank you for publishing this amazing project.

Currently, I am trying to deploy the project to a digital ocean droplet. I can access services like pgadmin, traefik and flower; however, on the base domain, I am missing a let's encrypt certificate (instead I am issued a traefik default cert).

Am I missing a configuration step besides the ones listed in the excellent deployment documentation? Or should the frontend and backend containers be part of the traefik netwok as well?

Thank you.

turukawa commented 10 months ago

Hey @an-mu

Everything needs to be part of the traefik network since the front- and back- are going to be communicating via the API. I'm assuming you followed the guide step-by-step? https://github.com/whythawk/full-stack-fastapi-postgresql/blob/master/docs/deployment-guide.md#traefik-proxy-with-https

an-mu commented 10 months ago

Hi @turukawa,

Thanks for the reply. Yes, I followed the guide step-by-step, but I'll do a fresh setup just to make sure. Could you clarify the following: I noticed that all services that have a valid let's encrypt certificate have a "networks" option in the docker-compose.yml, but neither backend nor frontend do. Could this be the reason why I am missing the certificates for these two services? If not, could you briefly explain, why "networks" is not necessary here?

Thanks again

turukawa commented 10 months ago

TBH, this is where I look over my shoulder at the original repo. Part of the reason I wrote this very detailed documentation is because - outside of those lines - I don't know very much about the way traefik or docker swarm work unless I spend a few hours revising.

However, this may have nothing to do with that, and sorry if this is all basic level, but it's sometimes useful to just go through everything and check ... is everything referenced correctly at the domain registrar (your various DNS records)? do you reference the api endpoint correctly from the .env files in the frontend? Oh, and sometimes the .sh files get their line endings wrecked when moving from Windows to Unix and things get strange. If all of that is correct, then it's time to start going through your specific build and deployment.

As an example, this is the most recent deployment I've done using this stack, and running at DO: https://globalhealthstudybuilder.org/ Same workflow, and everything seems to be ok.

an-mu commented 10 months ago

All right, then it seems I messed up the stack somewhere. Thanks for taking the time to respond to my questions, for confirming the docker-compose file should work as is and for your pointers on what to check.

turukawa commented 10 months ago

If it does break for something I haven't documented, please let me know. Always good to add gotchas to the documentation for future reference. It means we keep improving things. Thanks.