-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
-
First Check
- I added a very descriptive title here.
- I used the GitHub search to find a similar question and didn't find it.
- I searched in the documentation/README.
- I already searched in Google "How to do X" and didn't find any information.
- I already read and followed all the tutorial in the docs/README and didn't find an answer.
Commit to Help
- I commit to help with one of those options 👆
Example Code
NA
Description
Ive been developing locally for months on this stack and now that its time to deploy im having a bit of a nightmare.
Can anyone tell me where they host it and what kind of a setup you have so at least i know im heading in the right direction?
Thanks
Operating System
Linux
Operating System Details
Mac
Python Version
Python 3.9.6
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 5 comments 4 replies
-
I'm deploying on a VPS with github workflow.
I following this documentation
On VPS server you have to :
- configure and running traefik network container doc
- install github runner to check it deployment WF are running doc
To not store secret on server or on .env, I prefered to add secrets in Github UI through actions variables used by https://github.com/fastapi/full-stack-fastapi-template/blob/master/.github/workflows/deploy-production.yml
Beta Was this translation helpful? Give feedback.
All reactions
-
It would be really great if they included an example host in the docs and visual instructions.
i ended up using Render
2 x Services and a Postgres DB
Just a matter of getting the env values correct then.
Beta Was this translation helpful? Give feedback.
All reactions
-
@ChrisSQL sorry, I know it's been a while, but I'm struggling to get this deployed.
Can I ask which settings you used in Render to split out the services like that? Specifically, do you specify the Dockerfiles for each service? (ie ./backend/Dockerfile and ./frontend/Dockerfile)
... and does that require other changes from the Render settings (except maybe for environment vars etc)
thanks!
Beta Was this translation helpful? Give feedback.
All reactions
-
It's not using dockerfiles at all. They are redundant when you split it out
You're looking for the front end, backend and database links from your render settings
Setup db first
Get those settings
Setup backend
Put db settings in backend and get that going
Then do frontend connecting to backend
Try setup the db and backend and let me know where you get stuck.
Beta Was this translation helpful? Give feedback.
All reactions
-
BACKEND ENV VARIABLES
BACKEND_CORS_ORIGINS
https://full-stack-fastapi-template-xxxxx.onrender.com,
http://full-stack-fastapi-template-xxxxx.onrender.com,
http://localhost:3000,
https://localhost:3000,
http://localhost:3001,
https://localhost:3001,
ENVIRONMENT
production
FIRST_SUPERUSER <- i believe this is from backend settings
FIRST_SUPERUSER_PASSWORD same
FRONTEND_HOST <- your website
website.com
POSTGRES_DB <- get this from db setup
POSTGRES_PASSWORD <-same
POSTGRES_PORT 5432
POSTGRES_SERVER dpg-cvp6abuuk2gs7xxxxxx-a.xxxxxx-postgres.render.com
POSTGRES_USER <- from db setup
PROJECT_NAME whatever you want
SECRET_KEY <- your secret key from .env file i think. Dont think this is even used but i have it
Beta Was this translation helpful? Give feedback.
All reactions
-
DB will have no Env Variables
Beta Was this translation helpful? Give feedback.
All reactions
-
FRONTEND
youll use the Url of the backend
something like
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
I actually replaced the frontend with a NextJS boilerplate.
Either way same idea.
I did split but you dont have to. You can just set the folder on each of the settings frontend,backend.... and it picks it up when you deploy
Now im thinking with copilot it would be better to have them in same repo so you can bring things into context? works either way though.
Beta Was this translation helpful? Give feedback.