Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

2.6 KB
Raw Blame
networks:
  app-network:
    name: app-network
  shared-network:
    name: shared-network

volumes:
  test-db-data:
  clamav-data:

x-agpt-services:
  &agpt-services
  networks:
    - app-network
    - shared-network

services:
   
  db:
    <<: *agpt-services
    image: pgvector/pgvector:pg15
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}
      POSTGRES_DB: agpt_test
    ports:
      - ${POSTGRES_PORT:-5432}:5432
    volumes:
      - ../db/init/00-init.sql:/docker-entrypoint-initdb.d/00-init.sql:ro
      - test-db-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "postgres", "-h", "localhost"]
      interval: 5s
      timeout: 5s
      retries: 10

  # The backend's Redis client is cluster-only (`RedisClient = RedisCluster`),
  # and every other environment — `backend/.env.default`, the dev
  # `docker-compose.yml` and backend CI — serves a 3-shard cluster on
  # 17000/17001/17002. Reuse the dev stack's shards rather than a single-node
  # `redis:latest` on 6379: no supported client can talk to that, and no
  # config in the repo points at it.
  redis-0:
    <<: *agpt-services
    extends:
      file: ../docker-compose.platform.yml
      service: redis-0

  redis-1:
    <<: *agpt-services
    extends:
      file: ../docker-compose.platform.yml
      service: redis-1

  redis-2:
    <<: *agpt-services
    extends:
      file: ../docker-compose.platform.yml
      service: redis-2

  # `extends` deliberately drops `depends_on`, so the shard ordering the dev
  # stack relies on has to be restated here.
  redis-init:
    <<: *agpt-services
    extends:
      file: ../docker-compose.platform.yml
      service: redis-init
    depends_on:
      - redis-0
      - redis-1
      - redis-2

  rabbitmq:
    <<: *agpt-services
    image: rabbitmq:4.1.4
    container_name: rabbitmq
    healthcheck:
      test: rabbitmq-diagnostics -q ping
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 10s
    environment:
      - RABBITMQ_DEFAULT_USER=rabbitmq_user_default
      - RABBITMQ_DEFAULT_PASS=k0VMxyIJF9S35f3x2uaw5IWAl6Y536O7
    ports:
      - "5672:5672"
  clamav:
    image: clamav/clamav-debian:latest
    ports:
      - "3310:3310"
    volumes:
      - clamav-data:/var/lib/clamav
    environment:
      - CLAMAV_NO_FRESHCLAMD=false
      - CLAMD_CONF_StreamMaxLength=50M
      - CLAMD_CONF_MaxFileSize=100M
      - CLAMD_CONF_MaxScanSize=100M
      - CLAMD_CONF_MaxThreads=12
      - CLAMD_CONF_ReadTimeout=300
    healthcheck:
      test: ["CMD-SHELL", "clamdscan --version || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3