-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: one-click local deployment with docker compose (#3919) #4732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: one-click local deployment with docker compose (#3919) #4732
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a comprehensive local development environment using Docker Compose, which is a great addition for simplifying setup. The changes include adding service definitions, a Qdrant adapter to replace Pinecone locally, and necessary modifications to the backend code to support the emulated services. My review focuses on improving the robustness of the setup process. I've identified a couple of high-severity issues related to service health checking in the setup script which could lead to race conditions and setup failures. The proposed changes will make the local startup process more reliable.
Summary
docker compose upone-click local deployment using real service substitutes (Firebase Emulator Suite, Redis, Typesense, Qdrant) instead of shallow mocksWhat's included
New files (10)
docker-compose.ymldocker/firebase-emulator/Dockerfiledocker/firebase-emulator/firebase.jsondocker/firebase-emulator/storage.rulesbackend/.env.dockerbackend/database/qdrant_adapter.pyscripts/init_typesense.pyscripts/seed_local.pyscripts/local_setup.shSELF_HOSTING.mdModified files (3, minimal changes)
backend/database/vector_db.pyQDRANT_HOSTbefore Pinecone) + None guards on 7 unprotected functionsbackend/utils/conversations/search.pyhttps)backend/utils/other/storage.pyService mapping
FIRESTORE_EMULATOR_HOST)FIREBASE_AUTH_EMULATOR_HOST)STORAGE_EMULATOR_HOST)redis:7-alpine(drop-in, same protocol)qdrant/qdrant(adapter translates API calls)typesense/typesense:27.1(HTTP instead of HTTPS)Test plan
docker compose up --build— all 5 services start and pass health checkscurl http://localhost:8080/— backend respondscurl http://localhost:4000— Firebase Emulator UI loadspython3 scripts/seed_local.py— creates test user, prints tokencurl -H "Authorization: Bearer <token>" http://localhost:8080/v1/users/me— authenticated request worksKnown limitations
Closes #3919