Sinaptik-AI / pandas-ai

Chat with your database (SQL, CSV, pandas, polars, mongodb, noSQL, etc). PandasAI makes data analysis conversational using LLMs (GPT 3.5 / 4, Anthropic, VertexAI) and RAG.
https://pandas-ai.com
Other
12.68k stars 1.23k forks source link

docker-compose up fails #1232

Closed metalshanked closed 1 week ago

metalshanked commented 3 months ago

System Info

pandas 2.2

🐛 Describe the bug

get the below error when following the steps to run the platform with docker compose as mentioned in the docs.

I think the postgres container is listening on 5430:5432 so the default settings fail as below.

pandabi-backend | raise OSError(err, f'Connect call failed {address}') pandabi-backend | ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 5432)

dosubot[bot] commented 3 months ago

To resolve the issue where the PostgreSQL container is listening on port 5430:5432, causing the default settings to fail, you need to update the port mapping in your docker-compose.yml file to use the default PostgreSQL port 5432:5432.

Here is the updated docker-compose.yml configuration:

services:
  postgresql:
    image: postgres:14.2-alpine
    environment:
      POSTGRES_USER: pandasai
      POSTGRES_PASSWORD: password123
      POSTGRES_DB: pandasai-db
    ports:
      - "5432:5432"
    volumes:
      - ./pgdata:/var/lib/postgresql/data
    networks:
      - pandabi-network

  server:
    container_name: pandabi-backend
    build:
      context: ./server
      dockerfile: Dockerfile
    ports:
      - "8000:8000"
    restart: always
    env_file:
      - ./server/.env
    depends_on:
      - postgresql
    networks:
      - pandabi-network
    command: "/bin/bash startup.sh"

  client:
    container_name: pandabi-frontend
    build:
      context: ./client
      dockerfile: Dockerfile
    ports:
      - "3000:3000"
    restart: always
    env_file:
      - ./client/.env
    environment:
      - NODE_ENV=development
    command: npm run start
    networks:
      - pandabi-network

networks:
  pandabi-network:
    driver: bridge

By changing the port mapping from 5430:5432 to 5432:5432, the PostgreSQL container will listen on the default port 5432, which should resolve the issue with the default settings [1].

To continue talking to Dosu, mention @dosu.