Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Tinode rest_auth docker-compse

38 views
Skip to first unread message

vahid yg

unread,
Dec 28, 2024, 11:36:32 AM12/28/24
to Tinode General
Suppose this is a part of my docker-compose file
```
services:
  rest-api:
    build:
      context: .
    container_name:  rest-api
    ports:
      - '3000:3000'
    networks:
      - local-network

  postgres:
    container_name: postgres
    image: 'postgres:16'
    ports:
      - '5432:5432'
    networks:
      - local-network

  tinode-0:
    container_name: tinode-0
    networks:
      - local-network
    depends_on:
      - postgres
      - rest_api
    image: tinode/tinode:0.22.13
    volumes:
      - ./tinode.conf:/etc/tinode/tinode.conf
     
 
networks:
  local-network:
    driver: bridge
```

why this address is not available within the Tinode container
```
"server_url": "http://rest-api/v1/user/auth/tinode/",
```
and I should set
`network_mode: host`
and
`http://192.168.1.2:3000/v1/user/auth/tinode/`
to have a successful connection?

Gene

unread,
Dec 28, 2024, 12:01:57 PM12/28/24
to Tinode General
I don't know. Why is it not available? Could it be because in some cases you call it rest_api and in some rest-api?

You can login into a running container and test what's available and what's not available.

vahid yg

unread,
Dec 28, 2024, 1:03:49 PM12/28/24
to Tinode General
No, the container name is "rest-api" in all configs. 
 It's a common problem in Golang apps because it uses the DNS of the system that it's compiled in it, not the destination system DNS.
So I didn't see any example using container URL as server_url, all of them use IP 

Gene

unread,
Dec 28, 2024, 1:21:53 PM12/28/24
to Tinode General
On Saturday, December 28, 2024 at 9:03:49 PM UTC+3 vahid yg wrote:
No, the container name is "rest-api" in all configs. 

Really?
Reply all
Reply to author
Forward
0 new messages