Comments (6)
Do you mean you want to create an independent server that serves only html? If so, Ngnix can be used to serve static files. You can do this by creating a Ngnix container and setting the volume to ./app/web:/static
in the volumes section. Of course, this also requires Traefik routing, and since Traefik's Host rule overlaps with the value used by the existing Fastapi server, you can move the hostrules to a different domain, so you can prevent access to FastAPI container.
from llmchat.
The plan is to use a single shared instances of mysql, qdrant, redis and if possible fastAPI. then the frontend is independent per domain. I am also investigation simply symlinking the app/ folder. Avoiding duplicated code base for multiple domains on same server. using Nginx and traefik on same deployment can lead to nightmares. Lets take our time on this one. No rush
from llmchat.
So you're saying that if you're running multiple domains, you want to set up the backend instance on a single server, and only assign the frontend to each domain.
I guess you want to replace the existing monolithic architecture with microservices.
Is this correct?
from llmchat.
Yes and no. More like make fastAPI a headless backend by decoupling web. Here is a simplified version:
`services:
core:
image: fastapi_core_image
environment:
# Pool configurations for each domain
POOL_1: "mysql+mysqlconnector://user1:password1@db:3306/db1"
POOL_2: "mysql+mysqlconnector://user2:password2@db:3306/db2"
REDIS_1: "redis://:password1@cache:6379/0"
REDIS_2: "redis://:password2@cache:6379/1"
QDRANT_1: "qdrant_collection_1"
QDRANT_2: "qdrant_collection_2"
domain1:
image: flutter_app
environment:
DOMAIN_ID: "1"
BACKEND_URL: "http://core:8000"
domain2:
image: flutter_app
environment:
DOMAIN_ID: "2"
BACKEND_URL: "http://core:8000"
`
This allows customization of frontend. Also it is a lighter architecture, web containers are thin clients.
For more complex systems, FastApi can stored the connection pool in a db instead of environment variables. This may be easier to implement and my preferred option. The db can be prepopulated with 20 connections or so. And a bash script runs the docker-compose instantiation.
Your thought?
from llmchat.
Clients will send API requests to the real domain rather than hitting the BACKEND_URL set to http://core:8000. Because it is the client's browser, not flutter_app, that sends the actual API request. So while it is possible to mediate APIs using internal service names, it seems unlikely that you will be able to completely separate backend and frontend.
from llmchat.
Okay for now I will symlink the code base among instances
from llmchat.
Related Issues (20)
- Save embeddings metadata to MySQL HOT 2
- Overlap embeddings HOT 2
- Trash bin HOT 1
- Add minimum hardware requirement
- Token conservation HOT 2
- production fails on debian 11 HOT 1
- docker-compose-lan HOT 1
- Fails on Docker swarm HOT 12
- Make qdrant collection name a constant HOT 2
- Chatroles.system default startup TMPL HOT 2
- Message prefix/suffix HOT 2
- Default system message HOT 7
- Modular architecture HOT 5
- Universal Sentence Encoder for embedding HOT 1
- New key before chatting is unnecessary
- [Feature Request] Support InternLM
- Can't login in web UI HOT 6
- How can I switch to local LLM engine HOT 3
- Fail to run api in docker HOT 3
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 llmchat.