# Taiga and ETL+BI

**URL:** <https://community.taiga.io/t/taiga-and-etl-bi/2323>\
**Category:** Tenzu (previously Taiga Next)\
**Created:** [December 15, 2023, 7:07pm UTC](https://community.taiga.io/t/taiga-and-etl-bi/2323 "2023-12-15T19:07:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![collex100](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/collex100/32/1091_2.png) [@collex100](https://community.taiga.io/u/collex100)\
**Post date:** [December 15, 2023, 7:07pm UTC](https://community.taiga.io/t/taiga-and-etl-bi/2323/1 "2023-12-15T19:07:09Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![david.barragan](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/david.barragan/32/293_2.png) [@david.barragan](https://community.taiga.io/u/david.barragan)\
**Post date:** [January 2, 2024, 12:19pm UTC](https://community.taiga.io/t/taiga-and-etl-bi/2323/2 "2024-01-02T12:19:29Z")

</div>

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`

```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](https://docs.docker.com/compose/networking/)

Best regards

---

<div class="post-metadata">

**Author:** ![collex100](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/collex100/32/1091_2.png) [@collex100](https://community.taiga.io/u/collex100)\
**Post date:** [January 3, 2024, 7:33am UTC](https://community.taiga.io/t/taiga-and-etl-bi/2323/3 "2024-01-03T07:33:18Z")

</div>

Thank you very much I will try.

---

<div class="post-metadata">

**Author:** ![collex100](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/collex100/32/1091_2.png) [@collex100](https://community.taiga.io/u/collex100)\
**Post date:** [January 3, 2024, 9:27am UTC](https://community.taiga.io/t/taiga-and-etl-bi/2323/4 "2024-01-03T09:27:30Z")

</div>

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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![david.barragan](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/david.barragan/32/293_2.png) [@david.barragan](https://community.taiga.io/u/david.barragan)\
**Post date:** [January 3, 2024, 10:14am UTC](https://community.taiga.io/t/taiga-and-etl-bi/2323/5 "2024-01-03T10:14:01Z")

</div>

There is no special recommendation. It is something that does not depend on taiga but on the oficial postgresql image and its documentation [[1]](https://hub.docker.com/_/postgres) [[2]](https://www.docker.com/blog/how-to-use-the-postgres-docker-official-image/).

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.

---

<div class="post-metadata">

**Author:** ![collex100](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/collex100/32/1091_2.png) [@collex100](https://community.taiga.io/u/collex100)\
**Post date:** [January 3, 2024, 11:00am UTC](https://community.taiga.io/t/taiga-and-etl-bi/2323/6 "2024-01-03T11:00:52Z")

</div>

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