Container deployment
This guide provides example instructions for deploying SerenityGPT using containers and Docker Compose. Container deployment offers flexibility and consistency across different environments.
Tip
Running the application in Docker Compose is not recommended for production environments. However, because many organizations have their own deployment preferences, Docker Compose is a good way of explaining the basic requirements of a deployment.
Prerequisites
Before you begin, ensure you have:
- A container runtime (such as Docker) installed on your system.
- Access to the SerenityGPT container registry.
- Your SerenityGPT license key.
- A PostgreSQL database with pgvector extension (see Provisioning a Database).
Steps
Note
This is a simplified summary of steps documented in Getting the container images. Refer to that guide for more detailed instructions.
- Pull the SerenityGPT image.
- Configure environment variables.
- Deploy using Docker Compose.
- Verify the deployment.
1. Pull the SerenityGPT image:
Log in to the SerenityGPT container registry:
Pull the latest SerenityGPT image:
2. Configure environment variables:
Create a .env
file with the necessary configuration. Here are the key variables you need to set:
# Database configuration
DB_NAME=serenitydb
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_HOST=your_db_host
DB_PORT=5432
# Azure Entra ID configuration
AAD_TENANT_ID=your_tenant_id
AAD_CLIENT_ID=your_client_id
AAD_CLIENT_SECRET=your_client_secret
AAD_REDIRECT_URI=https://your-serenitygpt-hostname/login/aad/callback
For a complete list of configuration options, refer to the Configuration Reference.
3. Deploy using Docker Compose:
Create a docker-compose.yml
file with the following content:
version: '3'
services:
serenitygpt:
image: serenitygpt.azurecr.io/serenitygpt:latest
env_file: .env
ports:
- "8080:8080"
depends_on:
- db
db:
image: pgvector/pgvector:pg16
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata:
Start the SerenityGPT services:
4. Verify the deployment:
Check if the containers are running:
Access the SerenityGPT web interface at http://localhost:8080
.
That completes the deployment process for a test instance!
Troubleshooting
If you encounter issues:
- Check container logs:
docker-compose logs serenitygpt
- Verify environment variables:
docker-compose exec serenitygpt env
- Ensure the database is accessible from the container
Troubleshooting the database connection
If you're having trouble connecting to the database, check that the DB_HOST
in your .env
file is set correctly.
For local deployments, you may need to use host.docker.internal
instead of localhost
.
For more detailed configuration options and best practices, refer to the Configuration Reference.
Conclusion
You should now have a working SerenityGPT instance that you can use to test and experiment with the features of SerenityGPT! To deploy a production instance, refer to the next section of this documentation.