Skip to content

Guide to configure trino

For trino tool you need to make some configuration to run it on your computer or to connect it with other services. To have access in the swagger of the tool run the tool and go to http://localhost:49788/docs

  1. If you want to run trino as service you need to edit some variables of .env file inside the repo of the tool. You need to edit only variables based on the database. To run trino you need to have node 20.17.0. After that run command npm run debug
DB_HOST=postgres
DB_PORT=5432
DB_NAME=trino_tool
DB_USER=postgres
DB_PASS="1234"
  1. If you want to run trino with docker, except of .env file, you need also to edit the same variables in docker compose.yaml file. Also you need docker to be installed in your pc and run command docker-compose up --build More specifically:
services:
  backend:
    container_name: trinoutils
    environment:
      - NODE_ENV=db
      - SERVER_PORT=49788
      - ALLOWED_ORIGINS="*"
      - DB_HOST=postgres 
      - DB_PORT=5432
      - DB_NAME=trino_tool
      - DB_USER=postgres
      - DB_PASS=1234
    build:
      context: ./
    ports:
      - 49788:49788
    restart: unless-stopped

  postgres:
    container_name: postgres_db
    image: postgres:latest
    restart: unless-stopped
    environment:
      POSTGRES_DB: trino_tool
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: 1234
    env_file:
      - .env  
    ports:
      - 15432:5432
    volumes:
      - postgres_data:/var/lib/postgresql/data

From these variables i recommend you to only edit postgres variables, because if you edit other variables probably you need to edit it also on other files of the code. For example just edit these variables

  - DB_PORT=5432
  - DB_NAME=trino_tool
  - DB_USER=postgres
  - DB_PASS=1234

and these

environment:
  POSTGRES_DB: trino_tool
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: 1234
env_file:
  - .env  
ports:
  - 15432:5432

if you run another tool in port 5432 just edit the external port for example "15432" (you don't need to change the internal port 5432) and make new server in pgadmin with this values.

image

If you have any questions please contact me

Edited by Nick Tepe