Comments (6)
I'm glad it's been useful!
Yes, that's the next thing I'll do, an equivalent to this project but based on FastAPI. I hope to release it in the next days / week.
As everything is very modular, you can add your Angular code to replace the Vue.js frontend but keeping the Docker multi-stage build (if you want more details on Docker multi-stage build for Angular, check: https://medium.com/@tiangolo/angular-in-docker-with-nginx-supporting-environments-built-with-multi-stage-docker-builds-bb9f1724e984).
As the backend uses SQLAlchemy, you will be able to replace the PostgreSQL with MariaDB (or MySQL) very easily, mainly changing the Docker DB image.
About Nginx, as FastAPI is asynchronous, using Uvicorn with ASGI (instead of WSGI), is production ready, you don't need Nginx. Actually, it has some of the best achievable performances: https://fastapi.tiangolo.com/#performance
And if you use FastAPI you can use the official image: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker
from full-stack.
Hello Sebastián.
Thank you for your reply. I see your comment about Nginx is not needed if I'm using FastAPI and Uvicorn. This is my misunderstanding. I thought Nginx would be needed to serve static files (html/css etc...) and FastAPI was only for the api. I will read up on how to serve my Angular static files with Uvicorn.
Regards,
Bryan
from full-stack.
Ah, get it. Actually, Nginx makes sense for your static files (and frontend). This stack (and the next one) have Nginx serving the frontend. But only that service. The backend is served by Uvicorn managed by Gunicorn.
from full-stack.
Here it is! 🎉 🍰 🚀
FastAPI with PostgreSQL using SQLAlchemy: https://github.com/tiangolo/full-stack-fastapi-postgresql
You can change it to MariaDB or MySQL by modifying a couple of lines in the docker-compose files and a couple of lines in the code and the Alembic configs. But as it uses SQLAlchemy, most of the code should be quite standard for any of these relational DBs.
from full-stack.
Hi @bryanray67 , I'll assume you were able to solve your problem and I'll close this issue now.
If you are still using this project, I suggest you check the equivalent project generator for FastAPI that solves the same use cases in a much better way.
Because of that, this Flask-based project generator is now going to be deprecated. You are still free to use it, but it won't receive any new features, changes, or bug fixes.
from full-stack.
@bryanray67 @tiangolo #23 (comment)
I'm having a lot of trouble fixing the Alembic config for this, any chance you can give me an idea for that?
I've done the docker-compose(image), alembic/env.py (env variables), app/core/config.py (PostgresDsn --> AnyUrl, and env variables), as well as added the drivers as dependencies in pyproject.toml (have tried all drivers because of a consistent ACCESS DENIED error from the backend with credentials that work from within the docker container itself) prior to building the image (from a clean spot as well). Here is a bit more info if anyone has a few minutes: PyMySQL/PyMySQL#909 (comment)
from full-stack.
Related Issues (16)
- backports.functools_lru_cache HOT 1
- Localhost login error after running Pytest HOT 13
- Cannot create container for service proxy: b'Mount denied:\nThe source path "\\\\var\\\\run\\\\docker.sock:/var/run/docker.sock"\nis not a valid Windows path' HOT 2
- How to setup Flask-Admin HOT 5
- Request: more documentation for configuring/setting up tasks HOT 4
- Flower not showing tasks/workers in development HOT 5
- apispec marshmellow error when attempting to run app via manage.py HOT 2
- Expected username password for pgAdmin4 on startup after first docker-compose up HOT 5
- How to troubleshoot a service when it fails to run [workflow for docker swarm deploy] HOT 3
- Modify the existing nginx configuration, including an additional nginx module HOT 3
- How to add Websockets HOT 4
- Traefik on Swarm deploy HOT 4
- backend app won't start HOT 1
- Compose file invalid when running `docker-compose up -d` HOT 2
- Error after running docker-compose up -d HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from full-stack.