Skip to content

Latest commit

 

History

History
133 lines (89 loc) · 4.12 KB

DeploymentGuide.md

File metadata and controls

133 lines (89 loc) · 4.12 KB

Deploying the Phospho Platform with Docker

Welcome! This guide will help you deploy the Phospho Platform using Docker Compose. Phospho is an advanced backoffice for managing your LLM apps, with tools like clustering, data labeling, and user analytics. This deployment guide is designed to provide easy-to-follow steps, allowing you to set up Phospho locally or on your server.

Prerequisites

1. Create a Propelauth Account

Propelauth is used for authentication and security.

2. Obtain an OpenAI API Key

An OpenAI API Key is required for analytics and clustering.

3. Register for MongoDB

MongoDB will serve as a database solution. You can use a local one or MongoDB Atlas, the cloud solution.

4. Install Docker

Docker is used to containerize your application, ensuring consistency across different environments.

5. Set up Google Cloud Platform (GCP)

The GCP Natural Language API is used for to detect the language and the sentiment of user messages.

6. Set up Temporal

Temporal is used as a brocker to manage jobs and long computations.

Step 1: Set Up Your Project Directory

First, clone the repository containing the source code of the platform with

git clone https://github.com/phospho-app/phospho.git

Step 2: Set up your environment files

First create in the root folder a file called .env.docker following this example:

# Application Environment
APP_ENV=local
ENVIRONMENT="test"

# API Configuration
API_VERSION=v0
NEXT_PUBLIC_API_VERSION=v0
NEXT_PUBLIC_API_URL=http://127.0.0.1:8000
LOCAL_API_URL=http://127.0.0.1:8000
NEXT_PUBLIC_LOCAL_API_URL=http://127.0.0.1:8000

# Authentication Settings
NEXT_PUBLIC_AUTH_URL=https://<your_id>.propelauthtest.com
PROPELAUTH_API_KEY=
PROPELAUTH_REDIRECT_URI=http://localhost:3000/api/auth/callback
PROPELAUTH_VERIFIER_KEY=-----BEGIN PUBLIC KEY-----
PROPELAUTH_URL="https://<your_id>.propelauthtest.com"

# GCP Configuration
GCP_PROJECT_ID=""
GCP_SERVICEACCOUNT_EMAIL=
GCP_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----
GCP_JSON_CREDENTIALS_NATURAL_LANGUAGE_PROCESSING=
GCP_JSON_CREDENTIALS_BUCKET=

# OPENAI API Key For Chat and Embedding models
OPENAI_API_KEY=
OPENAI_BASE_URL=
# MongoDB Database Configuration
MONGODB_NAME="test"
MONGODB_URL=""

# Local Development Settings
TEMPORAL_HOST_URL=host.docker.internal:7233
TEMPORAL_NAMESPACE=default
TEMPORAL_MTLS_TLS_CERT_BASE64=
TEMPORAL_MTLS_TLS_KEY_BASE64=

# (OPTIONNAL) Services and Integrations
RESEND_API_KEY=
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
SENTRY_DSN=
EXTRACTOR_SENTRY_DSN=
SLACK_URL=
AZURE_OPENAI_KEY=
AZURE_OPENAI_ENDPOINT=
TEST_PROPELAUTH_ORG_ID=
TEST_PROPELAUTH_USER_ID=

Make sure to replace the placeholders with your actual credentials. These environment variables are essential for connecting the different components of the Phospho platform. Please put this .env file in the platform, ai-hub and backendfolder

Step 3: Build and run

Temporal

Make sure Temporal is running. Use the Temporal CLI to do so.

temporal server start-dev --db-filename your_temporal.db --ui-port 7999

For production environment, we recommend you use the Cloud version of Temporal. If so, make sure to update the env variables starting with TEMPORAL_.

Docker compose

docker compose up

Conclusion

Congratulations! You have successfully deployed the Phospho platform with Docker. You can now start exploring the platform and use its powerful tools to manage your LLM apps more effectively.

If you run into any issues, feel free to ask for support to [email protected]