Documentation
version: "3.8"

services:
  # Konarr Server
  konarr:
    container_name: konarr
    image: ghcr.io/42bytelabs/konarr:v0.4.0
    # Manually build the image
    # build:
    #   context: .
    #   dockerfile: ./server/Dockerfile
    restart: unless-stopped
    ports:
      # Expose the server on port 9000
      - "9000:9000"
    volumes:
      # Mount the data and config volumes
      - data:/data
      - config:/config

  # Konarr Agent (CLI)
  konarr-agent:
    container_name: konarr-agent
    image: ghcr.io/42bytelabs/konarr-cli:v0.4.0
    # Manually build the image
    # build:
    #   context: .
    #   dockerfile: ./cli/Dockerfile
    # Run the agent in monitoring mode
    command: agent
    restart: unless-stopped
    # Wait for the server to be ready
    depends_on:
      - konarr
    environment:
      # Project name of the Konarr server
      KONARR_HOST: konarr-server
      KONARR_AUTO_INSTALL: "true"
    volumes:
      # Share the configuration with the server
      - config:/config
      # Toolcache directory for storing downloaded tools
      - ./toolcache:/usr/local/toolcache
      # Docker socket
      - /var/run/docker.sock:/var/run/docker.sock:ro

volumes:
  data:
  config: