Hosting TutoriaLLM
How to Host the Application
To host TutoriaLLM, you need to set up the frontend, backend, and database. Below is a guide on hosting the TutoriaLLM app using Docker Compose and a hosting service of your choice.
Hosting the Backend and Database
Use Docker Compose to host the backend and database. Follow the steps below to host the TutoriaLLM app. Prepare a server (e.g., VPS) or a computer with Docker installed.
Pulling the Backend Docker Image
The image is available on Docker Hub. While multiple versions are provided, it is recommended to use the latest version. To use the image, you need to connect to Pgvector (or PostgreSQL with vector support).
About Versions
TutoriaLLM offers multiple versions to ensure stability. For details on version changes, refer to the GitHub repository:
latest
- Latest releaserelease_[YYYY-DDMM-BUILD_NUMBER]
- Versioned releases
latest-preview
- Latest development releasepreview_[YYYY-DDMM-BUILD_NUMBER]
- Development versions
Creating the Compose File
Below is an example of a production-ready docker-compose.yml
file.
Setting Environment Variables
Below is an example of environment variables. Adjust them according to your deployment method:
-
OPENAI_API_KEY - Key for using the OpenAI API
-
OPENAI_API_ENDPOINT - Endpoint for OpenAI API. Defaults to the standard endpoint if not set.
-
POSTGRES_USER - Database username
-
POSTGRES_PASSWORD - Database password
-
DB_PORT=5432 - Database port
-
POSTGRES_DB - Database name
-
DB_HOST - Database host
-
DEFAULT_USER_NAME - Default username
-
DEFAULT_USER_PASSWORD - Default user password
-
SENTRY_DSN - Optional, DSN for Sentry.io to track backend errors
-
DOMAIN - App domain name, used for automatic SSL configuration
-
EMAIL - App email address, used for automatic SSL configuration
-
CORS_ORIGIN - CORS settings, set the frontend URL
Starting the App
Run the following command in the directory containing the Compose file and .env
file to start the app:
Hosting the Frontend
There are several ways to host the frontend. This guide explains how to host it using Vercel or Netlify.
Forking the Repository
Fork the GitHub repository.
Hosting
Set up the following configurations on your hosting service to deploy the app:
Setting Environment Variables
- VITE_BACKEND_URL - Backend API endpoint
Build Settings
Build all packages from the root directory using the pnpm build:all
command:
- Build Command:
pnpm build:all
Then upload the built frontend files to the hosting service. - Build Directory:
/apps/frontend/dist
Using Docker
As environment variables must be set when building the frontend files, Docker images for the frontend are not provided on Docker Hub. Use the Dockerfile
in the repository to build the image for the frontend.