The Docker Compose File

This page holds the complete docker-compose.yml for the Docker Compose installation. Copy it into a file, and Docker starts the management app and its database with one command.


1. Save the file

  1. Create an installation directory and go into it, for example /opt/aiknowledgefabric.

  2. Create a file called docker-compose.yml in it.

  3. Copy the whole file from section 2 below into it and save it.

Do not change the file for a first start. Settings such as the port and the passwords go into a separate .env file next to it. The installation guide says how.

After you saved the file, go back to Step 3 of the installation.

Requirements: Docker Engine 24 or newer, with the Compose plugin 2.24 or newer. Older versions reject the line env_file with required: false. Check with docker compose version.


2. The file

services:

  postgres:
    image: postgres:16-alpine
    container_name: aiknowledgefabric-db
    restart: unless-stopped
    environment:
      POSTGRES_DB: AIKnowledgeFabric
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: ${DB_PASSWORD:-admin}
    volumes:
      - postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U admin -d AIKnowledgeFabric"]
      interval: 5s
      timeout: 5s
      retries: 10
    networks:
      - internal

  app:
    image: cyrockai/knowledge-fabric-frontend:1
    pull_policy: always
    container_name: aiknowledgefabric-app
    restart: unless-stopped
    ports:
      - "${APP_PORT:-8080}:8080"
    # Hands every variable in .env to the app (METRICS_API_KEY, JWT_EXPIRY_HOURS, SESSION_COOKIE_NAME, ...).
    # Without this line .env only fills the ${...} placeholders in this file and everything else is
    # silently ignored. A missing .env is fine; values under environment: below win over .env.
    env_file:
      - path: .env
        required: false
    environment:
      DB_URL: jdbc:postgresql://postgres:5432/AIKnowledgeFabric
      DB_USERNAME: admin
      DB_PASSWORD: ${DB_PASSWORD:-admin}
      COMPOSE_DIR: /app/compose-files
      # Agents and GraphRAG Topics write their Compose files into the same volume, in their own folders.
      # Without these two lines they would live in the container's writable layer and vanish when the
      # app container is recreated, after which a running agent could no longer be stopped.
      AGENT_COMPOSE_DIR: /app/compose-files/agents
      GRAPHRAG_COMPOSE_DIR: /app/compose-files/graphrag
      # Without a valid license nothing can be created or started. Can also be entered under Admin → License.
      CYROCK_LICENSE_KEY: ${CYROCK_LICENSE_KEY:-}
      RAG_SERVICE_IMAGE: ${RAG_SERVICE_IMAGE:-cyrockai/knowledge-fabric-topic}
      RAG_SERVICE_IMAGE_VERSION: ${RAG_SERVICE_IMAGE_VERSION:-1}
      RAG_SERVICE_PULL_POLICY: ${RAG_SERVICE_PULL_POLICY:-Always}
      AGENT_SERVER_IMAGE: ${AGENT_SERVER_IMAGE:-cyrockai/knowledge-fabric-agent}
      AGENT_SERVER_IMAGE_VERSION: ${AGENT_SERVER_IMAGE_VERSION:-1}
      AGENT_SERVER_PULL_POLICY: ${AGENT_SERVER_PULL_POLICY:-Always}
      GRAPHRAG_SERVICE_IMAGE: ${GRAPHRAG_SERVICE_IMAGE:-cyrockai/knowledge-fabric-gtopic}
      GRAPHRAG_SERVICE_IMAGE_VERSION: ${GRAPHRAG_SERVICE_IMAGE_VERSION:-1}
      GRAPHRAG_SERVICE_PULL_POLICY: ${GRAPHRAG_SERVICE_PULL_POLICY:-Always}
      # Allows the app to reach per-topic RAG containers via host-exposed ports
      RAG_SERVICE_HOST: host.docker.internal
      # Allows the app to reach per-topic GraphRAG containers via host-exposed ports
      GRAPHRAG_SERVICE_HOST: host.docker.internal
      # Allows the app to reach per-agent containers via host-exposed ports
      AGENT_SERVICE_HOST: host.docker.internal
      # Allows the app to reach Docling server containers via host-exposed ports
      DOCLING_SERVICE_HOST: host.docker.internal
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - compose-files:/app/compose-files
    depends_on:
      postgres:
        condition: service_healthy
    networks:
      - internal

volumes:
  postgres-data:
  compose-files:

networks:
  internal:
    driver: bridge

3. What the file does

The file starts two containers. The comments inside it explain the less obvious lines.

Part What it does Change it when

postgres

The database where the app keeps topics, agents, pipelines, users, roles and chat history. The password comes from DB_PASSWORD (the default admin is only for a first test). The health check makes the app wait until the database is ready

Never. Set the password in .env before the first start

app → image

The management app. The tag :1 is the current release of the major version 1. It moves forward by itself with every update

You want to pin an exact version

app → pull_policy: always

Each start looks for a newer image of the same tag

Never

app → ports

The web UI on port 8080 of the host. Set APP_PORT in .env to use another port

Another port, or when a reverse proxy should be the only way in ("127.0.0.1:${APP_PORT:-8080}:8080")

app → env_file

Passes every variable of your .env file to the app. The file is optional

Never

app → environment

Settings the app needs: the database address, the folders for generated files, the license key, and which images the app uses for Topics, GraphRAG Topics and Agents. Values written here win over .env

You want to set something for good. Otherwise use .env

*_SERVICE_HOST: host.docker.internal

How the app reaches the containers it starts. They are published on the host, so the app talks to the host

Only if the host cannot be reached under this name

extra_hosts

Makes the name host.docker.internal work on Linux, too

Never

volumes → docker.sock

Lets the app start and stop containers on this host. Access to this socket is like root access to the host — see why the socket is mounted

Never

volumes → compose-files

Keeps the generated Compose files of all Topics, GraphRAG Topics, Agents and managed servers. Without them, running resources cannot be stopped from the UI

Never

volumes (bottom)

postgres-data holds all configuration. Losing it loses everything. Back it up

Never

The settings you can put into .env are listed in Configuration of the installation guide.


4. Keeping the file up to date

The file changes now and then. Compare your copy with this page after an update of the app. A new version of this page means new lines, for example a new setting. Copy the new lines into your file, or replace the whole file if you changed nothing in it, and then run:

docker compose up -d

Running resources are not stopped by this. The update steps say what else to do.