Skip to content

Latest commit

 

History

History
105 lines (75 loc) · 2.77 KB

File metadata and controls

105 lines (75 loc) · 2.77 KB

Docker Guide

This guide covers running Morphic with Docker, including development setup, prebuilt images, and deployment options.

Quick Start with Docker Compose

  1. Configure environment variables:
cp .env.local.example .env.local

Edit .env.local and set the required variables:

DATABASE_URL=postgresql://morphic:morphic@postgres:5432/morphic
OPENAI_API_KEY=your_openai_key
TAVILY_API_KEY=your_tavily_key
BRAVE_SEARCH_API_KEY=your_brave_key

Note: Authentication is disabled by default (ENABLE_AUTH=false in .env.local.example).

Optional: Customize PostgreSQL credentials by setting environment variables in .env.local:

POSTGRES_USER=morphic      # Default: morphic
POSTGRES_PASSWORD=morphic  # Default: morphic
POSTGRES_DB=morphic        # Default: morphic
POSTGRES_PORT=5432         # Default: 5432
  1. Start the Docker containers:
docker compose up -d

The application will:

  • Start PostgreSQL 17 with health checks
  • Start Redis for SearXNG search caching
  • Wait for the database to be ready
  • Run database migrations automatically
  • Start the Morphic application
  • Start SearXNG (optional search provider)
  1. Visit http://localhost:3000 in your browser.

Note: Database data is persisted in a Docker volume. To reset the database, run:

docker compose down -v  # This will delete all data

Using Prebuilt Image

Prebuilt Docker images are automatically built and published to GitHub Container Registry:

docker pull ghcr.io/miurla/morphic:latest

You can use it with docker-compose by setting the image in your docker-compose.yaml:

services:
  morphic:
    image: ghcr.io/miurla/morphic:latest
    env_file: .env.local
    environment:
      DATABASE_URL: postgresql://morphic:morphic@postgres:5432/morphic
      DATABASE_SSL_DISABLED: 'true'
      ENABLE_AUTH: 'false'
    ports:
      - '3000:3000'
    depends_on:
      - postgres
      - redis

Note: The prebuilt image runs in anonymous mode only (ENABLE_AUTH=false). Supabase authentication cannot be enabled because NEXT_PUBLIC_* environment variables are embedded at build time by Next.js. To enable authentication or customize model configurations, you need to build from source — see CONFIGURATION.md for details.

Building from Source

Use Docker Compose for a complete setup with PostgreSQL, Redis, and SearXNG. See the Quick Start section above.

Useful Commands

# Start all containers in background
docker compose up -d

# Stop all containers
docker compose down

# Stop all containers and remove volumes (deletes database data)
docker compose down -v

# View logs
docker compose logs -f morphic

# Rebuild the image
docker compose build morphic