Skip to content

Container

Docker Compose

This exemplary docker-compose setup shows the deployment of a Crow instance connected to GitHub (CROW_GITHUB=true). If you are using another forge, please change this including the respective secret settings.

It creates persistent volumes for the server and agent config directories. The bundled SQLite DB is stored in /var/lib/crow and is the most important part to be persisted as it holds all users and repository information.

The server uses the default port 8000 and gets exposed to the host here, so Crow can be accessed through this port on the host or by a reverse proxy sitting in front of it.

Info

The deployment of crow-autoscaler is optional. Only a brief skeleton is added below for demonstration purposes. Please check the Autoscaler documentation and decide whether or not the Autoscaler is a good fit for your environment. It also contains the information how to configure the Autoscaler in detail.

services:
  crow-server:
    image: codeberg.org/crowci/crow-server:<tag>
    ports:
      - 8000:8000
    volumes:
      - crow-server:/var/lib/crow/
    environment:
      - CROW_OPEN=true
      - CROW_HOST=${CROW_HOST}
      - CROW_GITHUB=true
      - CROW_GITHUB_CLIENT=${CROW_GITHUB_CLIENT}
      - CROW_GITHUB_SECRET=${CROW_GITHUB_SECRET}
      - CROW_AGENT_SECRET=${CROW_AGENT_SECRET}

  crow-agent:
    image: codeberg.org/crowci/crow-agent:<tag>
    restart: always
    depends_on:
      - crow-server
    volumes:
      - crow-agent:/etc/crow
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - CROW_SERVER=crow-server:9000
      - CROW_AGENT_SECRET=${CROW_AGENT_SECRET}

  # OPTIONAL
  crow-autoscaler:
    image: codeberg.org/crowci/crow-autoscaler:<tag>
    restart: always
    depends_on:
      - crow-server
    environment:
      - CROW_SERVER=https://your-crow-server.com
      - CROW_TOKEN=${CROW_TOKEN}
      - CROW_MIN_AGENTS=0
      - CROW_MAX_AGENTS=3
      - CROW_WORKFLOWS_PER_AGENT=2
      - CROW_GRPC_ADDR=https://grpc.your-crow-server.com
      - CROW_GRPC_SECURE=true
      - CROW_PROVIDER=hetznercloud
      - CROW_HETZNERCLOUD_API_TOKEN=${CROW_HETZNERCLOUD_API_TOKEN}

Docker Swarm

You can also deploy CrowCI on a Docker Swarm cluster. The following example can serve as a starting point:

services:
  crow-server:
    image: codeberg.org/crowci/crow-server:<tag>
    networks:
      - traefik-public
      - crowci
    deploy:
      replicas: 1
    volumes:
      # A persistent NFS directory is used so it can be mounted to any swarm node
      - /docker-host/nfsvolumes/crow/server:/var/lib/crow/
    environment:
      CROW_OPEN: "true"
      CROW_FORGEJO: "true"
      CROW_FORGEJO_URL: "${FORGEJO_URL}"
      CROW_FORGEJO_CLIENT: "${FORGEJO_CLIENT}"
      CROW_FORGEJO_SECRET: "${FORGEJO_SECRET}"
      CROW_ADMIN: "${CROW_ADMIN}"
      CROW_HOST: "https://${CROW_URI_DOMAIN}"

  crow-agent:
    image: codeberg.org/crowci/crow-agent:<tag>
    networks:
      - crowci
    depends_on:
      - crow-server
    volumes:
      # A persistent NFS directory is used so it can be mounted to any swarm node
      - /docker-host/nfsvolumes/crow/agent:/etc/crow
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      CROW_SERVER: "crow-server:9000"
      CROW_AGENT_SECRET: "${CROW_GLOBAL_AGENT_SECRET}"

networks:
  crowci: