Main thing I've changed is the outgoing port (from...
# support-questions
s
Main thing I've changed is the outgoing port (from 5432 to 5433, so it doesn't conflict with my primary app database)
n
Hi @semagraph , Can you try changing both incoming and outgoing to 5433 and seeing if that helps?
s
Hey, yeah I tried changing all port values to 5433 but still had the same error
Does the image expect port 5432?
I think the only time I’ve got it to work is when using that port number
n
So 5433:5432 should have worked. Give us a couple minutes, well debug and let you know
s
Cheers
seems like it could be an issue with SpringBoot configuration
you might not be passing the docker env variables to it properly
n
Hey so we used this docker file to make it work
Copy code
version: '3'

services:
  supertokens:
    image: registry.supertokens.io/supertokens/supertokens-postgresql
    depends_on:
      - supertokensdatabase
    ports:
      - 3567:3567
    environment:
      POSTGRESQL_CONNECTION_URI: "postgresql://supertokens:somePassword@supertokensdatabase:5432/supertokens?schema=public"
    networks:
      - app_network
      - supertokens_network
    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

  supertokensdatabase:
    image: 'postgres:latest'
    restart: always
    environment:
      POSTGRES_USER: supertokens
      POSTGRES_PASSWORD: somePassword
      POSTGRES_DB: supertokens
    ports:
      - 5433:5432
    networks:
      - supertokens_network
    volumes:
      - ./volumes/postgres:/var/lib/postgresql/data
    healthcheck:
      test: ['CMD', 'pg_isready -U supertokens']
      interval: 5s
      timeout: 5s
      retries: 5

networks:
  app_network:
    driver: bridge
  supertokens_network:
    driver: bridge
We renamed
supertokens_database
to
supertokensdatabase
(underscores are a problem here) and we changed the connection uri to
postgresql://supertokens:somePassword@supertokensdatabase:5432/supertokens?schema=public
. Since the services are on the same network it needed to use the internal port and not outgoing
s
cool, I'll give that a try
yeah that did the trick, thanks man
n
Happy to help!
s
if I give you the changes necessary to get the nest.js integration working with nest-fastify, can you guys update your docs with those changes?
n
You could open an issue about it here: https://supertokens.com/docs and someone from the team would be happy to move forward with it
Cant promise on when that would happen though