01/06/2023, 5:41 PM
docker-compose SuperTokens, MYSQL + Node.js APP
docker-compose.yml version: '3' services: db: image: mysql:latest environment: MYSQL_ROOT_PASSWORD: root MYSQL_USER: supertokens_user MYSQL_PASSWORD: somePassword MYSQL_DATABASE: supertokens ports: - 3306:3306 networks: - app_network restart: unless-stopped healthcheck: test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost'] timeout: 20s retries: 10 supertokens: image: depends_on: - db ports: - 3567:3567 environment: MYSQL_CONNECTION_URI: mysql://supertokens_user:somePassword@db:3306/supertokens networks: - app_network restart: unless-stopped healthcheck: test: > bash -c 'exec 3<>/dev/tcp/ && echo -e "GET /hello HTTP/1.1\r\nhost:\r\nConnection: close\r\n\r\n" >&3 && cat <&3 | grep "Hello"' interval: 10s timeout: 5s retries: 5 server: depends_on: - db - supertokens build: context: ./server dockerfile: Dockerfile.server ports: - "80:80" networks: - app_network restart: unless-stopped healthcheck: test: curl -fs http://localhost:80/health || exit 1 interval: 1h timeout: 5s retries: 3 networks: app_network: driver: bridge
Inside Dockerfile.server ENV SUPERTOKENS_ADDRESS supertokens:3567
Giving following Error: server_1 | Error: Please provide a valid domain name server_1 | at normaliseURLDomainOrThrowError (/node_modules/supertokens-node/lib/build/normalisedURLDomain.js:67:11) server_1 | at new NormalisedURLDomain (/node_modules/supertokens-node/lib/build/normalisedURLDomain.js:24:22) server_1 | at /node_modules/supertokens-node/lib/build/supertokens.js:351:39 server_1 | at () server_1 | at new SuperTokens (/node_modules/supertokens-node/lib/build/supertokens.js:349:24) server_1 | at SuperTokensWrapper.init (/node_modules/supertokens-node/lib/build/supertokens.js:384:36) server_1 | at Object. (/dist/index.js:20:28) server_1 | at Module._compile (node:internal/modules/cjs/loader:1159:14) server_1 | at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) server_1 | at Module.load (node:internal/modules/cjs/loader:1037:32)
The ENV that I'm passing: ENV SUPERTOKENS_ADDRESS supertokens:3567 Is it correct?
I tried localhost:3567 as well, but not working


01/07/2023, 4:06 AM
You need to give http://supertokens:3567