-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: one-click deployment for omi backend (#3919) #6598
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?
Changes from 1 commit
46a931b
dcbd7d5
51d8aab
7bfcabf
bfdc4e6
6acf387
01d66ff
8add9a8
5d8a30f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,72 @@ | ||||||||||||
| version: '3.8' | ||||||||||||
|
|
||||||||||||
| services: | ||||||||||||
| backend: | ||||||||||||
| build: | ||||||||||||
| context: . | ||||||||||||
| dockerfile: Dockerfile | ||||||||||||
| ports: | ||||||||||||
| - "8080:8080" | ||||||||||||
| environment: | ||||||||||||
| - DATABASE_URL=${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/omi} | ||||||||||||
| - REDIS_URL=${REDIS_URL:-redis://redis:6379} | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Two mismatches here that will silently break the services:
Replace with the variables the backend actually consumes:
Suggested change
|
||||||||||||
| - TYPESENSE_HOST=${TYPESENSE_HOST:-typesense} | ||||||||||||
| - TYPESENSE_PORT=${TYPESENSE_PORT:-8108} | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
| - TYPESENSE_API_KEY=${TYPESENSE_API_KEY:-xyz} | ||||||||||||
| depends_on: | ||||||||||||
| postgres: | ||||||||||||
| condition: service_healthy | ||||||||||||
| redis: | ||||||||||||
| condition: service_healthy | ||||||||||||
| typesense: | ||||||||||||
| condition: service_healthy | ||||||||||||
| volumes: | ||||||||||||
| - ./:/app | ||||||||||||
|
|
||||||||||||
| postgres: | ||||||||||||
| image: postgres:15-alpine | ||||||||||||
| environment: | ||||||||||||
| POSTGRES_USER: postgres | ||||||||||||
| POSTGRES_PASSWORD: postgres | ||||||||||||
| POSTGRES_DB: omi | ||||||||||||
| ports: | ||||||||||||
| - "5432:5432" | ||||||||||||
| volumes: | ||||||||||||
| - postgres_data:/var/lib/postgresql/data | ||||||||||||
| healthcheck: | ||||||||||||
| test: ["CMD-SHELL", "pg_isready -U postgres"] | ||||||||||||
| interval: 5s | ||||||||||||
| timeout: 5s | ||||||||||||
| retries: 5 | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The backend's primary datastore is Firestore (Google Cloud), not PostgreSQL. The The actual credentials the backend needs to start are |
||||||||||||
|
|
||||||||||||
| redis: | ||||||||||||
| image: redis:7-alpine | ||||||||||||
| ports: | ||||||||||||
| - "6379:6379" | ||||||||||||
| volumes: | ||||||||||||
| - redis_data:/data | ||||||||||||
| healthcheck: | ||||||||||||
| test: ["CMD", "redis-cli", "ping"] | ||||||||||||
| interval: 5s | ||||||||||||
| timeout: 5s | ||||||||||||
| retries: 5 | ||||||||||||
|
|
||||||||||||
| typesense: | ||||||||||||
| image: typesense/typesense:0.25.1 | ||||||||||||
| ports: | ||||||||||||
| - "8108:8108" | ||||||||||||
| environment: | ||||||||||||
| - TYPESENSE_API_KEY=xyz | ||||||||||||
| - TYPESENSE_DATA_DIR=/data | ||||||||||||
| volumes: | ||||||||||||
| - typesense_data:/data | ||||||||||||
| healthcheck: | ||||||||||||
| test: ["CMD", "curl", "-f", "http://localhost:8108/health"] | ||||||||||||
| interval: 5s | ||||||||||||
| timeout: 5s | ||||||||||||
| retries: 5 | ||||||||||||
|
|
||||||||||||
| volumes: | ||||||||||||
| postgres_data: | ||||||||||||
| redis_data: | ||||||||||||
| typesense_data: | ||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Omi Backend One-Click Deployment | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ```bash | ||
| ./install.sh | ||
| ``` | ||
|
|
||
| ## Deployment Modes | ||
|
|
||
| ### QUICK START | ||
| - Minimal configuration | ||
| - No API keys required | ||
| - Perfect for testing and development | ||
|
|
||
| ### FULL SETUP | ||
| - All features enabled | ||
| - Requires API key configuration | ||
| - Production-ready deployment | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Docker | ||
| - Docker Compose | ||
|
|
||
| ## Services Included | ||
|
|
||
| - **Backend**: Main Omi API server | ||
| - **PostgreSQL**: Database | ||
| - **Redis**: Cache and message queue | ||
| - **Typesense**: Search engine | ||
|
|
||
| ## Health Checks | ||
|
|
||
| All services include health checks to ensure proper startup order. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,50 @@ | ||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||
| set -e | ||||||||||||||||||||
|
|
||||||||||||||||||||
| echo "===================================" | ||||||||||||||||||||
| echo "Omi Backend One-Click Deployment" | ||||||||||||||||||||
| echo "===================================" | ||||||||||||||||||||
| echo "" | ||||||||||||||||||||
| echo "Select deployment mode:" | ||||||||||||||||||||
| echo "1) QUICK START - Minimal setup, no API keys needed" | ||||||||||||||||||||
| echo "2) FULL SETUP - All features enabled" | ||||||||||||||||||||
| echo "" | ||||||||||||||||||||
| read -p "Enter choice [1 or 2]: " choice | ||||||||||||||||||||
|
|
||||||||||||||||||||
| if [ "$choice" = "1" ]; then | ||||||||||||||||||||
| echo "" | ||||||||||||||||||||
| echo "Starting QUICK START mode..." | ||||||||||||||||||||
| export QUICK_START=true | ||||||||||||||||||||
| docker-compose -f docker-compose.yaml up -d | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Either wire
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
| elif [ "$choice" = "2" ]; then | ||||||||||||||||||||
| echo "" | ||||||||||||||||||||
| echo "Starting FULL SETUP mode..." | ||||||||||||||||||||
| echo "Please ensure you have configured your API keys in .env file" | ||||||||||||||||||||
| read -p "Press Enter to continue..." | ||||||||||||||||||||
| docker-compose -f docker-compose.yaml up -d | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The README instructs users to run Use the script's own directory to build an absolute path:
Suggested change
(Apply the same fix to the |
||||||||||||||||||||
| else | ||||||||||||||||||||
| echo "Invalid choice. Exiting." | ||||||||||||||||||||
| exit 1 | ||||||||||||||||||||
| fi | ||||||||||||||||||||
|
|
||||||||||||||||||||
| echo "" | ||||||||||||||||||||
| echo "===================================" | ||||||||||||||||||||
| echo "Waiting for services to be ready..." | ||||||||||||||||||||
| echo "===================================" | ||||||||||||||||||||
| sleep 10 | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The compose file already configures health checks with
Suggested change
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| echo "" | ||||||||||||||||||||
| echo "Checking service health..." | ||||||||||||||||||||
| docker-compose ps | ||||||||||||||||||||
|
|
||||||||||||||||||||
| echo "" | ||||||||||||||||||||
| echo "===================================" | ||||||||||||||||||||
| echo "Omi backend is now running!" | ||||||||||||||||||||
| echo "===================================" | ||||||||||||||||||||
| echo "Backend: http://localhost:8080" | ||||||||||||||||||||
| echo "PostgreSQL: localhost:5432" | ||||||||||||||||||||
| echo "Redis: localhost:6379" | ||||||||||||||||||||
| echo "Typesense: localhost:8108" | ||||||||||||||||||||
| echo "" | ||||||||||||||||||||
| echo "To view logs: docker-compose logs -f" | ||||||||||||||||||||
| echo "To stop: docker-compose down" | ||||||||||||||||||||
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.
The existing
backend/Dockerfilewas written to be built from the repository root: it usesCOPY backend/requirements.txtandCOPY backend/ ., which require the context to include abackend/subdirectory. Settingcontext: .whendocker-compose.yamllives insidebackend/makes the contextbackend/, so Docker will look forbackend/backend/requirements.txt— which doesn't exist and causes the build to fail immediately.Fix: set the context to the repo root.