Get the image
-
After getting an issued Docker PAT
-
Authenticate with your token:
docker login --username literalai
- Pull the image
docker pull literalai/platform:latest
Host the image
Google Artifactory Registry
- Tag the image:
docker tag literalai/platform:latest <region>-docker.pkg.dev/<project_id>/<artifactory_name>/platform:latest
- Push the image
docker push <region>-docker.pkg.dev/<project_id>/<artifactory_name>/platform:latest
Google Container Registry
- Tag the image:
docker tag literalai/platform:latest gcr.io/<project_id>/platform:latest
- Push the image:
docker push gcr.io/<project_id>/platform:latest
Amazon ECR
- Tag the image:
docker tag literalai/platform:latest <aws_account_id>.dkr.ecr.<region>.amazonaws.com/literalai/platform:latest
- Push the image
docker push <aws_account_id>.dkr.ecr.<region>.amazonaws.com/literalai/platform:latest
Run the application
- Once your image is accessible you can then host the application using the service of your choice.
Here is a non exhaustive list:
- To configure the application you will be required to pass your own environment variables.
Let’s go over the required values:
DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<db_name><?pgbouncer=true if using pg-bouncer>
DATABASE_DIRECT_URL=postgresql://<username>:<password>@<host>:<port>/<db_name>
NEXTAUTH_SECRET="your secret"
NEXTAUTH_URL="https://yourdomain.com"
BUCKET_NAME=""
APP_AWS_ACCESS_KEY="access key"
APP_AWS_SECRET_KEY="secret key"
APP_AWS_REGION="region"
APP_GCS_PROJECT_ID="project id"
APP_GCS_CLIENT_EMAIL="client email"
APP_GCS_PRIVATE_KEY="private key"
APP_AZURE_STORAGE_ACCOUNT="azure storage account"
APP_AZURE_STORAGE_ACCESS_KEY="azure storage key"
- [OPTIONAL] Setup Redis to reduce latency:
REDIS_URL="redis://127.0.0.1:6379/0"
REDISHOST=
REDISPORT=
- [OPTIONAL] Configure authentication methods:
ENABLE_CREDENTIALS_AUTH=true
EMAIL_SERVER_HOST="servicehost"
EMAIL_SERVER_PORT="4000"
EMAIL_SERVICE="gmail"
EMAIL_USER="username"
EMAIL_PASS="password"
EMAIL_FROM="noreply@service.com"
GOOGLE_CLIENT_ID="your id"
GOOGLE_CLIENT_SECRET="your secret"
GITHUB_ID="your id"
GITHUB_SECRET="your secret"
AZURE_AD_CLIENT_ID="your id"
AZURE_AD_CLIENT_SECRET="your secret"
AZURE_AD_TENANT_ID="your tenant id"
OKTA_CLIENT_ID="your id"
OKTA_CLIENT_SECRET="your secret"
OKTA_ISSUER="the issuer"
- [OPTIONAL] Add monitoring
ENABLE_VERCEL_ANALYTICS=true
SENTRY_ORG="org"
SENTRY_PROJECT="project"
NEXT_PUBLIC_SENTRY_DSN="sentry-dsn"
SENTRY_AUTH_TOKEN="sentry-auth-token"
Configuring storage
In order to be able to use the storage solution of your choice, you will need to configure CORS for it.
If you enabled OAuth authentication in the environment variables, don’t forget to allow the callback url for each of the providers. The callback url is in the form:
<protocol>://<domain>/api/auth/callback/<provider>
The server within the docker image will run on port 3000
. Don’t forget to expose it.
You should now be ready to start the container.
Once you successfully deployed the Literal Platform, don’t forget to set the following environment variables in your Chainlit App.
LITERAL_SERVER=https://my-literal.com
LITERAL_API_KEY=my project api key