I am running supertoken using self-hosted core. I want to run both my auth server (nestjs) and auth ...
r
I am running supertoken using self-hosted core. I want to run both my auth server (nestjs) and auth core using docker-compose. The issue is I am not able to pass the connectionURI of the core to the server. my authcore service is named -
authCore
so I tried passing
authCore:3567
but this doesn't work I see following error -
Copy code
Error: Please provide a valid domain name
    at normaliseURLDomainOrThrowError (/app/node_modules/supertokens-node/lib/build/normalisedURLDo

    at new NormalisedURLDomain (/app/node_modules/supertokens-node/lib/build/normalisedURLDomain.js

    at /app/node_modules/supertokens-node/lib/build/supertokens.js:350:39
    at Array.map (<anonymous>)
    at new SuperTokens (/app/node_modules/supertokens-node/lib/build/supertokens.js:348:24)
    at Function.init (/app/node_modules/supertokens-node/lib/build/supertokens.js:372:36)
    at new SupertokensService (/app/src/auth/supertokens/supertokens.service.ts:15:17)
    at Injector.instantiateClass (/app/node_modules/@nestjs/core/injector/injector.js:358:19)
    at callback (/app/node_modules/@nestjs/core/injector/injector.js:59:45)
    at Injector.resolveConstructorParams (/app/node_modules/@nestjs/core/injector/injector.js:139:2
r
Hey. You need to add http:// to the url
r
Tried that already. I get this error -
Copy code
[Nest] 41  - 07/02/2023, 4:46:33 PM   ERROR [ExceptionsHandler] getaddrinfo ENOTFOUND shojaauthcore
Error: getaddrinfo ENOTFOUND shojaauthcore
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
Started SuperTokens on 0.0.0.0:3567 with PID: 36
02 Jul 2023 16:46:33:974 +0000 | INFO | pid: f3131e7a-b2f3-480d-b189-237f20f9f15d | [main] thread |
n.java:269) | Tenant(, public, public) | Started SuperTokens on 0.0.0.0:3567 with PID: 36

[Nest] 41  - 07/02/2023, 4:46:34 PM   ERROR [ExceptionsHandler] getaddrinfo ENOTFOUND shojaauthcore
Error: getaddrinfo ENOTFOUND shojaauthcore
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
[Nest] 41  - 07/02/2023, 4:46:34 PM   ERROR [ExceptionsHandler] getaddrinfo ENOTFOUND shojaauthcore
Error: getaddrinfo ENOTFOUND shojaauthcore
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
02 Jul 2023 16:46:34:634 +0000 | INFO | pid: f3131e7a-b2f3-480d-b189-237f20f9f15d | [pool-1-thread-
r
can i see your docker compose file?
r
Here is Dockerfile.dev for Auth server -
Copy code
FROM node:18

COPY ./package.json /tmp/package.json
RUN cd /tmp && yarn
RUN mkdir -p /app && cp -a /tmp/node_modules /app/
WORKDIR "/app"
RUN npm install -g @nestjs/cli
COPY . .
r
shoja_auth_server and shoja_app_server are not part of the shoja_network network
you need to add:
Copy code
networks:
      - shoja_network
to those two as well
r
ahh, sorry. I am a docker newbie
checking now
You are a rock star!! That solved my issue 🙂
23 Views