# To boot the app run the following:
# docker compose run auto-gpt
# NOTE: Version 3.9 requires at least Docker Compose version 2 and Docker Engine version 20.10.13!

version: "3.9"

services:
  auto-gpt:
    build:
      context: ../
      dockerfile: Dockerfile.autogpt
    env_file:
      - .env
    ports:
      - "8000:8000"
    volumes:
      - ./:/app/classic/original_autogpt/
      - ./docker-compose.yml:/app/docker-compose.yml:ro
      # - ./Dockerfile:/app/Dockerfile:ro
    profiles: ["exclude-from-up"]

  # Only for TESTING purposes. Run with: docker compose run --build --rm autogpt-test
  autogpt-test:
    build:
      context: ../
      dockerfile: Dockerfile.autogpt
    env_file:
      - .env
    environment:
      S3_ENDPOINT_URL: http://minio:9000
      AWS_ACCESS_KEY_ID: minio
      AWS_SECRET_ACCESS_KEY: minio123
    entrypoint: ["poetry", "run"]
    command: ["pytest", "-v"]
    volumes:
      - ./autogpt:/app/classic/original_autogpt/autogpt
      - ./tests:/app/classic/original_autogpt/tests
    depends_on:
      - minio
    profiles: ["exclude-from-up"]
  minio:
    image: minio/minio
    environment:
      MINIO_ACCESS_KEY: minio
      MINIO_SECRET_KEY: minio123
    ports:
      - 9000:9000
    volumes:
      - minio-data:/data
    command: server /data
    profiles: ["exclude-from-up"]
volumes:
  minio-data:
