title: docker kong error to get connection with postgres
body: <p><strong>My dockerCompose.yml</strong>:</p>
  <pre><code>version: &quot;3.7&quot;
  
  networks: 
    kong-net:
  
  volumes:
    kong_data: {}
    pghr:
      external: true
    pginv:
      external: true
  services:
    #######################################
    # Postgres: The database used by Kong
    #######################################
    kong-database:
      image: postgres:11
      container_name: kong-postgres
      restart: on-failure
      networks:
        - kong-net
      volumes:
        - kong_data:/var/lib/postgresql/data
      environment:
        POSTGRES_USER: kong
        POSTGRES_PASSWORD: kong
        POSTGRES_DB: kong
      ports:
        - &quot;5434:5434&quot;
      healthcheck:
        test: [&quot;CMD&quot;, &quot;pg_isready&quot;, &quot;-U&quot;, &quot;kong&quot;]
        interval: 30s
        timeout: 30s
        retries: 3
  
    #######################################
    # Kong database migration
    #######################################
    kong-migration:
      image: kong:2.0.3-alpine
      command: kong migrations bootstrap
      networks:
        - kong-net
      restart: on-failure
      environment:
        KONG_DATABASE: postgres
        KONG_PG_HOST: kong-database
        KONG_PG_DATABASE: kong
        KONG_PG_USER: kong
        KONG_PG_PASSWORD: kong
      depends_on:
        - kong-database
  
    #######################################
    # Kong: The API Gateway
    #######################################
    kong:
      image: kong:2.0.3-alpine
      restart: on-failure
      container_name: kong
      networks:
        - kong-net
      environment:
        KONG_DATABASE: postgres
        KONG_PG_HOST: kong-database
        KONG_PG_DATABASE: kong
        KONG_PG_USER: kong
        KONG_PG_PASSWORD: kong
        KONG_PROXY_LISTEN: 0.0.0.0:8000
        KONG_PROXY_LISTEN_SSL: 0.0.0.0:8443
        KONG_ADMIN_LISTEN: 0.0.0.0:8001
      depends_on:
        - kong-database
      healthcheck:
        test: [&quot;CMD&quot;, &quot;kong&quot;, &quot;health&quot;]
        interval: 10s
        timeout: 10s
        retries: 10
      ports:
        - &quot;8000:8000&quot;
        - &quot;8001:8001&quot;
        - &quot;8443:8443&quot;
        - &quot;8444:8444&quot;
  
    #######################################
    # Konga database prepare
    #######################################
    konga-prepare:
      image: pantsel/konga:latest
      command: &quot;-c prepare -a postgres -u postgresql://kong:kong@kong-database:5434/konga&quot;
      networks:
        - kong-net
      restart: on-failure
      links:
        - kong-database
      depends_on:
        - kong-database
    
    #######################################
    # Konga: Kong GUI
    #######################################
    konga:
      image: pantsel/konga:latest
      container_name: konga
      restart: always
      networks:
        - kong-net
      environment:
        DB_ADAPTER: postgres
        DB_HOST: kong-database
        DB_USER: kong
        TOKEN_SECRET: FUEDASHFUAEHFEUAHFEU;
        DB_DATABASE: kong
        NODE_ENV: production
      depends_on:
        - kong-database
      ports:
        - &quot;1337:1337&quot;
  </code></pre>
  <p>but i get this on docker - compose logs on my container KONG:</p>
  <pre><code>kong                  | 2020/09/02 21:51:04 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:20: New migrations available; run 'kong migrations up' to proceed
  kong                  | stack traceback:
  kong                  |         [C]: in function 'error'
  kong                  |         /usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:20: in function 'check_state'
  kong                  |         /usr/local/share/lua/5.1/kong/init.lua:392: in function 'init'
  kong                  |         init_by_lua:3: in main chunk
  kong                  | nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:20: New migrations available; run 'kong migrations up' to proceed
  kong                  | stack traceback:
  kong                  |         [C]: in function 'error'
  kong                  |         /usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:20: in function 'check_state'
  kong                  |         /usr/local/share/lua/5.1/kong/init.lua:392: in function 'init'
  kong                  |         init_by_lua:3: in main chunk
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: using the &quot;epoll&quot; event method
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: openresty/1.15.8.3
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: built by gcc 9.2.0 (Alpine 9.2.0) 
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: OS: Linux 5.4.0-45-generic
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: getrlimit(RLIMIT_NOFILE): 1048576:1048576
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker processes
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker process 22
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker process 23
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker process 24
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker process 25
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker process 26
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker process 27
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker process 28
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker process 29
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker process 30
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker process 31
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker process 32
  kong                  | 2020/09/02 21:51:08 [notice] 1#0: start worker process 33
  kong                  | 2020/09/02 21:51:08 [notice] 22#0: *5 [lua] cache_warmup.lua:46: cache_warmup_single_entity(): Preloading 'services' into the core_cache..., context: init_worker_by_lua*
  kong                  | 2020/09/02 21:51:08 [notice] 22#0: *5 [lua] cache_warmup.lua:85: cache_warmup_single_entity(): finished preloading 'services' into the core_cache (in 0ms), context: init_worker_by_lua*
  kong                  | 2020/09/02 21:51:08 [notice] 22#0: *5 [lua] cache_warmup.lua:46: cache_warmup_single_entity(): Preloading 'plugins' into the core_cache..., context: init_worker_by_lua*
  kong                  | 2020/09/02 21:51:08 [notice] 22#0: *5 [lua] cache_warmup.lua:85: cache_warmup_single_entity(): finished preloading 'plugins' into the core_cache (in 0ms), context: init_worker_by_lua*
  </code></pre>
  <p>on my container Konga-prepare:</p>
  <pre><code>konga-prepare_1       | debug: Preparing database...
  konga-prepare_1       | Using postgres DB Adapter.
  konga-prepare_1       | Failed to connect to DB Error: connect ECONNREFUSED 192.168.64.2:5434
  konga-prepare_1       |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {
  konga-prepare_1       |   errno: 'ECONNREFUSED',
  konga-prepare_1       |   code: 'ECONNREFUSED',
  konga-prepare_1       |   syscall: 'connect',
  konga-prepare_1       |   address: '192.168.64.2',
  konga-prepare_1       |   port: 5434
  konga-prepare_1       | }
  </code></pre>
  <p>on my container konga:</p>
  <pre><code>konga                 |   _e: error: relation &quot;public.konga_users&quot; does not exist
  konga                 |       at Connection.parseE (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11)
  konga                 |       at Connection.parseMessage (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:366:17)
  konga                 |       at Socket.&lt;anonymous&gt; (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:105:22)
  konga                 |       at Socket.emit (events.js:310:20)
  konga                 |       at Socket.EventEmitter.emit (domain.js:482:12)
  konga                 |       at addChunk (_stream_readable.js:286:12)
  konga                 |       at readableAddChunk (_stream_readable.js:268:9)
  konga                 |       at Socket.Readable.push (_stream_readable.js:209:10)
  konga                 |       at TCP.onStreamRead (internal/stream_base_commons.js:186:23) {
  konga                 |     length: 118,
  konga                 |     severity: 'ERROR',
  konga                 |     code: '42P01',
  konga                 |     detail: undefined,
  konga                 |     hint: undefined,
  konga                 |     position: '377',
  konga                 |     internalPosition: undefined,
  konga                 |     internalQuery: undefined,
  konga                 |     where: undefined,
  konga                 |     schema: undefined,
  konga                 |     table: undefined,
  konga                 |     column: undefined,
  konga                 |     dataType: undefined,
  konga                 |     constraint: undefined,
  konga                 |     file: 'parse_relation.c',
  konga                 |     line: '1159',
  konga                 |     routine: 'parserOpenTable'
  konga                 |   },
  konga                 |   rawStack: 'error: relation &quot;public.konga_users&quot; does not exist\n' +
  konga                 |     '    at Connection.parseE (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11)\n' +
  konga                 |     '    at Connection.parseMessage (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:366:17)\n' +
  konga                 |     '    at Socket.&lt;anonymous&gt; (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:105:22)\n' +
  konga                 |     '    at Socket.emit (events.js:310:20)\n' +
  konga                 |     '    at Socket.EventEmitter.emit (domain.js:482:12)\n' +
  konga                 |     '    at addChunk (_stream_readable.js:286:12)\n' +
  konga                 |     '    at readableAddChunk (_stream_readable.js:268:9)\n' +
  konga                 |     '    at Socket.Readable.push (_stream_readable.js:209:10)\n' +
  konga                 |     '    at TCP.onStreamRead (internal/stream_base_commons.js:186:23)',
  konga                 |   details: 'Details:  error: relation &quot;public.konga_users&quot; does not exist\n'
  konga                 | }
  </code></pre>
  <p>I'm not able to imagine the reason for the error, my dockercompose seems to be configured correctly.
  I configured the right port, but I have these errors I tried to fix and I can't.</p>