Docker Compose, Ceramic can't connect to IPFS

Hi guys,
I have following compose.yml file

version: '2.24.6'
services:
  ipfs:
    image: ceramicnetwork/go-ipfs-daemon:latest
    ports:
      - 5001:5001
      - 8011:8011
    volumes:
      - ipfs-data:/data/ipfs
    healthcheck:
      test: ["CMD-SHELL", "ipfs --api=/ip4/127.0.0.1/tcp/5001 dag stat /ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"]
      interval: 10s
      timeout: 30s
      retries: 5
      start_period: 60s
  postgres:
    image: postgres:latest
    ports:
      - 5432:5432
    environment:
      - POSTGRES_PASSWORD=password
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - postgres-data:/var/lib/postgresql/data
  ceramic:
    image: ceramicnetwork/js-ceramic:latest
    ports:
      - 7007:7007
    # volumes:
    #   - ceramic-daemon-config:/root/.ceramic/daemon.config.json
    #   - ceramic-logs:/root/.ceramic/logs
    #   - ceramic-statestore:/root/.ceramic/statestore
    environment:
      - NODE_ENV=production
      - CERAMIC_INDEXING_DB_URI=postgres://postgres:password@host:5432/dema_ceramic
    depends_on:
      ipfs:
        condition: service_healthy
    command: --ipfs-api http://127.0.0.1:5001
volumes:
  ipfs-data:
  postgres-data:
  ceramic-daemon-config:
  ceramic-logs:
  ceramic-statestore:

somehow, the ceramic can’t connect to IPFS, although I can access both IPFS’s webui and API. Could you please help me which my configuration is incorrect? Thank you in advance!

ceramic-1   | Ceramic daemon failed to start up:
ceramic-1   | TypeError: fetch failed
ceramic-1   |     at node:internal/deps/undici/undici:12345:11
ceramic-1   |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
ceramic-1   |   cause: Error: connect ECONNREFUSED 127.0.0.1:5001
ceramic-1   |       at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1605:16) {
ceramic-1   |     errno: -111,
ceramic-1   |     code: 'ECONNREFUSED',
ceramic-1   |     syscall: 'connect',
ceramic-1   |     address: '127.0.0.1',
ceramic-1   |     port: 5001
ceramic-1   |   }
ceramic-1   | }
ceramic-1 exited with code 1```

@mohsin Do you have an idea for what could be happening here?

Apologies for the late reply.

@Rizky, can you please add the following section to each of your containers:

    networks: 
       - internal

And the following section to the end of the file, and try again?

 networks: 
   internal: 
     driver: bridge

If this still doesn’t work, would you mind sharing the logs from the containers as well?

Thanks.