Taiga and ETL+BI

I have an unusual question.

As a team, we want to visualize (BI) the action on tasks. To do this, we want to take data from the Postgres database using Arbyte ETL and then transfer the data to BI (SuperSet).

Does anyone have a similar experience?
Is it possible to access the database if it is located in docker?
Does anyone have any thoughts on this?

Thanks!

Hi @collex100

By default, ports that are not necessary are not exposed to the outside in taiga-docker, but you can modify it to make the database accessible.

You have to modify taiga-db service from taiga-docker/docker-compose.yml

# (...)
services:
  taiga-db:
    # (...)
    networks:
      - taiga
    ports:
      - "9991:5432"
    
# (...)

t is important to note the distinction between HOST_PORT and CONTAINER_PORT. In the above example, for taiga-db, the HOST_PORT is 9991 and the container port is 5432 (postgres default). Networked service-to-service communication uses the CONTAINER_PORT. When HOST_PORT is defined, the service is accessible outside the docker server as well. So now you can connect with a postgresql client/connector to the port 9991 of this server.

Here is an interesting and detailed link about networks in docker compose Networking in Compose | Docker Docs

Best regards

Thank you very much I will try.

In order to be able to read data from the database, I need to create a user with privileges in the postgres database.

Are there any recommendations on this?

I know that it is possible to execute a script when launching a container that would create such a user. But, I need advice on how to write this script.

Below are the commands that need to be executed.

CREATE USER <user_name> PASSWORD 'your_password_here';

GRANT USAGE ON SCHEMA <schema_name> TO <user_name>; 

GRANT SELECT ON ALL TABLES IN SCHEMA <schema_name> TO <user_name>; 

ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT SELECT ON TABLES TO <user_name>;

After such a user is in the database, we will be able to connect to the database and access the data.

There is no special recommendation. It is something that does not depend on taiga but on the oficial postgresql image and its documentation [1] [2].

Just a security warning, when opening ports and allowing external connections, be careful with user and privilege management. Maybe you should limit access (¿by IP?) modifying the pg_hba.conf file.

Thanks for the recommendations. Yes of course I need to look at IP restrictions