Documentation
Docker Deployment
Docker Deployment Guide
Infra0 is packaged as a Docker image and is deployed using Docker Compose.
Prerequisites
- Docker Engine 20.x or later
- Docker Compose v2.x or later
- PostgreSQL 14+ (provided by Docker Compose)
- Docker socket access (required for VS Container management)
Docker Compose Setup
The docker-compose.yaml file defines
- 1infra0-app: The Next.js application container
- 2postgres: The PostgreSQL database container
Environment Configuration
Create a .env file in the project root with:
# Database DATABASE_URL=postgresql://user:password@postgres:5432/infra0 DATABASE_SSL=false DATABASE_POOL_SIZE=10
# Authentication (Better-Auth) BETTER_AUTH_SECRET=your-secret-key BETTER_AUTH_URL=http://localhost:3000
# OAuth Providers (configure the ones you want to use) MICROSOFT_CLIENT_ID=your-azure-app-client-id MICROSOFT_CLIENT_SECRET=your-azure-app-secret GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret GITHUB_CLIENT_ID=your-github-client-id GITHUB_CLIENT_SECRET=your-github-client-secret
# AI Providers (configure the ones you want to use) ANTHROPIC_API_KEY=your-anthropic-api-key OPENAI_API_KEY=your-openai-api-key AZURE_OPENAI_API_KEY=your-azure-openai-key AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com GOOGLE_AI_API_KEY=your-google-ai-key OLLAMA_BASE_URL=http://localhost:11434
# Container Service (Docker socket) DOCKER_SOCKET_PATH=/var/run/docker.sock
# Feature Flags NEXT_PUBLIC_TICKETS_ENABLED=true NEXT_PUBLIC_APP_CREDENTIALS_ENABLED=true NEXT_PUBLIC_CREDENTIAL_TYPES_ENABLED=false NEXT_PUBLIC_CLOUD_PROVIDER_CREDENTIALS_ENABLED=true
Starting the Application
- 1Clone the repository
- 2Create and configure the .env file
- 3Run: docker compose up -d
- 4Wait for both containers to start
- 5Run database migrations: docker compose exec infra0-app npm run db:migrate
- 6Seed initial data: docker compose exec infra0-app npm run db:seed
- 7Access the application at http://localhost:3000
Docker Socket Access
- The application container mounts the Docker socket (/var/run/docker.sock)
- This allows Infra0 to create and manage VS Containers for workspaces
- Ensure the Docker socket is accessible and the container runs with appropriate permissions
Stopping the Application
- docker compose down (stops and removes containers)
- docker compose down -v (also removes the database volume — WARNING: data loss)
Healthy Deployment Checklist
- Database is accessible and migrations have run
- At least one OAuth provider or email auth is configured
- AI provider API key is configured
- Docker socket is mounted and accessible
- An Admin user account exists