Hey! I was having trouble while self-hosting the s...
# support-questions
a
Hey! I was having trouble while self-hosting the supertokens-core with
docker
&
PostgreSQL
, while fetching the dashboard i get an error -
no core to query
. here is the relevent part my dockerfile -
Copy code
authdb:
    container_name: authdb
    image: 'postgres:latest'
    environment:
      POSTGRES_USER: supertokens_user 
      POSTGRES_PASSWORD: somePassword 
      POSTGRES_DB: supertokens
    ports:
      - 5432:5432
    networks:
      - outpost-infra
    restart: unless-stopped
    healthcheck:
      test: ['CMD', 'pg_isready -U supertokens_user']
      interval: 10s
      timeout: 5s
      retries: 5
  supertokens:
    image: registry.supertokens.io/supertokens/supertokens-postgresql:4.3
    container_name: supertokens
    depends_on:
      - authdb
        # condition: service_healthy
    ports:
      - 3567:3567
    environment:
      POSTGRESQL_CONNECTION_URI: "postgresql://supertokens_user:somePassword@authdb:5432/supertokens"
    networks:
      - outpost-infra
    restart: unless-stopped
    healthcheck:
      test: >
        bash -c 'exec 3<>/dev/tcp/127.0.0.1/3567 && echo -e "GET /hello HTTP/1.1\r\nhost: 127.0.0.1:3567\r\nConnection: close\r\n\r\n" >&3 && cat <&3 | grep "Hello"'
      interval: 10s
      timeout: 5s
      retries: 5
networks:
  outpost-infra:
    attachable: true
    name: outpost-infra
    driver: bridge
while looking into issues... i found that the postgres container was unhealthy i've attached the logs as well.
this is the log for the postgres container
can someone please help me debug this
r
What is the backend supertokens init function call code?
Whats the value of
supertokensConnectionURI
?
a
sorry! i forgot to post that too, its
SUPERTOKENS_CONNECTION_URI=http://localhost:3567
r
can you navigate to
http://localhost:3567
on your browser. What do you see?
Also, if you are running the node fastify server in docker, you should change the connection uri to
http://supertokens:3567
a
according to the new docs, it should be -
Copy code
depends_on:
      authdb:
        condition: service_healthy
which does not start the supertokens container as authdb is unhealthy. but i've made it just to make it work i'm using old docs -
Copy code
depends_on:
      - authdb
on which i get
r
right yea. But then the
hello
call should not succeed cause that queries the db
so if authdb is unhealthy, then it should not be able to query the db
therefore calling the URL should return a 500 error
a
hey i fetched the dashboard again after changing the uri .... it looks fine 👍 ... thanks for the help. but the unhealthy problem still remains while following the new docs (
supertokens
not starting as
authdb
is
unhealthy
) what do you suggest i do for that currently?
do i remove the healthcheck for now?
r
hmm. You can. It's not an issue