title: Error timeout reached before the port went into state "inuse"
body: <p>Faced a problem with connection of postgresql to keycloak. In keycloak I tried to use 5433 and 5432 port in &quot;<code>KEYCLOAK_DATABASE_PORT</code>&quot;, but none of them is not working</p>
  <p><strong>docker compose</strong></p>
  <pre><code>version: &quot;3.8&quot;
  
  volumes:
    postgres_data:
      driver: local
  
  services:
    postgres:
      container_name: postgres.beltweet.com
      image: library/postgres
      volumes:
        - postgres_data:/var/lib/postgresql/data
      environment:
        POSTGRES_USER: postgres
        POSTGRES_PASSWORD: postgres
        POSTGRES_DB: beltweet
      ports:
        - &quot;5433:5432&quot;
      restart: unless-stopped
  
    keycloak:
      image: docker.io/bitnami/keycloak:latest
      container_name: keycloak.beltweet.com
      environment:
        KEYCLOAK_ADMIN_USER: admin
        KEYCLOAK_ADMIN_PASSWORD: 260
        KEYCLOAK_MANAGEMENT_PASSWORD: 260
        KEYCLOAK_DATABASE_PORT: 5432
        KEYCLOAK_DATABASE_HOST: postgres
        KEYCLOAK_DATABASE_NAME: beltweet
        KEYCLOAK_CREATE_ADMIN_USER: 'true'
        KEYCLOAK_DATABASE_USER: postgres
        KEYCLOAK_DATABASE_PASSWORD: postgres
        KEYCLOAK_HTTP_PORT: 3033
        KEYCLOAK_HTTPS_PORT: 3034
        KEYCLOAK_JGROUPS_DISCOVERY_PROTOCOL: JDBC_PING
        KEYCLOAK_CACHE_OWNERS_COUNT: 3
        KEYCLOAK_AUTH_CACHE_OWNERS_COUNT: 3
      depends_on:
        postgres:
          condition: service_started
      links:
        - &quot;postgres:postgres&quot;
  </code></pre>
  <p><strong>error</strong></p>
  <pre><code>Starting postgres.beltweet.com ... done
  Recreating keycloak.beltweet.com ... done
  Attaching to postgres.beltweet.com, keycloak.beltweet.com
  postgres.beltweet.com | 
  postgres.beltweet.com | PostgreSQL Database directory appears to contain a database; Skipping initialization
  postgres.beltweet.com | 
  postgres.beltweet.com | 2022-03-17 14:33:35.516 UTC [1] LOG:  starting PostgreSQL 14.2 (Debian 14.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  keycloak.beltweet.com | keycloak 14:33:35.99 
  keycloak.beltweet.com | keycloak 14:33:35.99 Welcome to the Bitnami keycloak container
  postgres.beltweet.com | 2022-03-17 14:33:35.516 UTC [1] LOG:  listening on IPv4 address &quot;0.0.0.0&quot;, port 5432
  postgres.beltweet.com | 2022-03-17 14:33:35.516 UTC [1] LOG:  listening on IPv6 address &quot;::&quot;, port 5432
  postgres.beltweet.com | 2022-03-17 14:33:35.517 UTC [1] LOG:  listening on Unix socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot;
  postgres.beltweet.com | 2022-03-17 14:33:35.520 UTC [26] LOG:  database system was shut down at 2022-03-17 14:33:30 UTC
  postgres.beltweet.com | 2022-03-17 14:33:35.523 UTC [1] LOG:  database system is ready to accept connections
  keycloak.beltweet.com | keycloak 14:33:35.99 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-keycloak
  keycloak.beltweet.com | keycloak 14:33:36.00 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-keycloak/issues
  keycloak.beltweet.com | keycloak 14:33:36.00 
  keycloak.beltweet.com | keycloak 14:33:36.00 INFO  ==&gt; ** Starting keycloak setup **
  keycloak.beltweet.com | keycloak 14:33:36.01 INFO  ==&gt; Validating settings in KEYCLOAK_* env vars...
  keycloak.beltweet.com | keycloak 14:33:36.02 INFO  ==&gt; Trying to connect to PostgreSQL server postgres...
  keycloak.beltweet.com | timeout reached before the port went into state &quot;inuse&quot;
  keycloak.beltweet.com | timeout reached before the port went into state &quot;inuse&quot;
  keycloak.beltweet.com | timeout reached before the port went into state &quot;inuse&quot;
  keycloak.beltweet.com | timeout reached before the port went into state &quot;inuse&quot;
  keycloak.beltweet.com | timeout reached before the port went into state &quot;inuse&quot;
  keycloak.beltweet.com | timeout reached before the port went into state &quot;inuse&quot;
  </code></pre>