Skip to Content
Technical DocumentationDeploymentOverview

Deployment Overview

This section covers deploying the TEA Platform for production use. The recommended approach is Docker Compose for self-hosting.

Development vs Production

For local development setup, see the Getting Started section. This section is for production deployments.

Deployment Options

The simplest way to deploy the TEA Platform is using Docker Compose. This bundles the application and database in containers that can run on any Docker-compatible host.

Suitable for:

  • Small to medium deployments
  • Single-server hosting
  • Organisations with Docker experience

See Docker Production for setup instructions.

Manual Deployment

For more control, you can deploy the components separately:

  • Next.js application on any Node.js hosting
  • PostgreSQL on a managed database service

This approach requires more configuration but allows integration with existing infrastructure.

Environment Variables

The TEA Platform is configured through environment variables. Here’s a reference of the key variables:

Required Variables

VariableDescriptionExample
DATABASE_URLPostgreSQL connection stringpostgresql://user:pass@host:5432/tea
NEXTAUTH_SECRETSecret for session encryptionGenerate with openssl rand -base64 32
NEXTAUTH_URLPublic URL of the applicationhttps://tea.example.com

Optional Variables

VariableDescriptionDefault
GITHUB_APP_CLIENT_IDGitHub OAuth client ID(disabled)
GITHUB_APP_CLIENT_SECRETGitHub OAuth client secret(disabled)
NODE_ENVEnvironment modeproduction

Database Configuration

VariableDescriptionDefault
POSTGRES_USERDatabase usertea
POSTGRES_PASSWORDDatabase password(required)
POSTGRES_DBDatabase nametea

Security Considerations

Secrets Management

  • Never commit secrets to version control
  • Use environment variables or a secrets manager
  • Rotate NEXTAUTH_SECRET periodically
  • Use strong, unique database passwords

Network Security

  • Run behind a reverse proxy (nginx, Traefik)
  • Enable HTTPS with a valid certificate
  • Restrict database access to application only
  • Consider network isolation for database

Authentication

  • Enable GitHub OAuth for easier user onboarding
  • Require email verification for local accounts
  • Implement rate limiting on authentication endpoints

Backup Strategy

Regular backups are essential for production deployments:

  1. Database backups - Daily automated backups
  2. Configuration backups - Store environment configs securely
  3. Test restores - Regularly verify backup integrity

See Database Management for backup procedures.

Monitoring

Consider monitoring for production deployments:

  • Application health - HTTP health checks
  • Database metrics - Connection pool, query performance
  • Error tracking - Application error monitoring
  • Uptime monitoring - External availability checks

Further Reading