version: '3'
services:
  langchain-playground:
    image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainplus-playground:latest
  langchain-frontend:
    image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainplus-frontend:latest
    ports:
      - 80:80
    environment:
      - REACT_APP_BACKEND_URL=http://localhost:1984
    depends_on:
      - langchain-backend
      - langchain-playground
  langchain-backend:
    image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainplus-backend:latest
    environment:
      - PORT=1984
      - LANGCHAIN_ENV=local_docker
      - LOG_LEVEL=warning
      - OPENAI_API_KEY=${OPENAI_API_KEY}
    ports:
      - 1984:1984
    depends_on:
      - langchain-db
  langchain-db:
    image: postgres:14.1
    command:
      [
        "postgres",
        "-c",
        "log_min_messages=WARNING",
        "-c",
        "client_min_messages=WARNING"
      ]
    environment:
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_DB=postgres
    volumes:
      - langchain-db-data:/var/lib/postgresql/data
    ports:
      - 5433:5432
volumes:
  langchain-db-data:
