title: Docker + docker compose + postgresql error
body: <p>I have an error connecting postgresql and app with docker compose. It seems to me that the problem lies in the fact that I connected the database via localhost(<a href="https://i.stack.imgur.com/PuthE.png" rel="nofollow noreferrer">https://i.stack.imgur.com/PuthE.png</a>). I tried to create a container based on the postgresql image, but intellij IDEA did not see the databases that I created in the container.</p>
  <p>**The failed attempt I'm talking about **</p>
  <pre><code>docker run -d -port 5432:5432 --name psql-img -e POSTGRES_PASSWORD=admin postgres:13
  docker exec -it psql-img bash
  </code></pre>
  <p>than I connected to the empty database that I create in psql-img container</p>
  <pre><code>psql -h db -p5432 -U postgres -W glerondb
  </code></pre>
  <p><strong>File tree</strong></p>
  <p><a href="https://i.stack.imgur.com/4hIa5.png" rel="nofollow noreferrer">https://i.stack.imgur.com/4hIa5.png</a></p>
  <p><strong>Docker file</strong></p>
  <pre><code>FROM openjdk:16
  
  ARG DIRECTORY=build/libs/*.jar
  COPY $DIRECTORY gleronn.jar
  
  ENTRYPOINT java -jar gleronn.jar
  </code></pre>
  <p><strong>Docker compose</strong></p>
  <pre><code>    version: &quot;3.7&quot;
  
  services:
    gleron:
      image: igleron
      container_name: cgleron
      build: ./
      environment:
        SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/gleron
      depends_on:
        - db
      ports:
        - &quot;8080:8080&quot;
    db:
      image: postgres
      environment:
        POSTGRESQL_PASSWORD: admin
        POSTGRESQL_USER: postgres
        POSTGRESQL_DB: gleron
      volumes:
      - ./pgdata:/var/lib/postgresql/data
      ports:
      - &quot;5432:5432&quot;
  </code></pre>
  <p><strong>Application properties</strong></p>
  <pre><code>spring.datasource.driver-class-name=org.postgresql.Driver
  spring.datasource.username=postgres
  spring.datasource.password=admin
  spring.datasource.url=jdbc:postgresql://db:5432/gleron
  
  spring.flyway.url=jdbc:postgresql://db:5432/gleron
  spring.flyway.user=postgres
  spring.flyway.password=admin
  
  spring.mail.host=smtp.mailtrap.io
  spring.mail.port=2525
  spring.mail.username=9fb579a8e4678b
  spring.mail.password=386ea16395fa62
  
  spring.security.oauth2.client.registration.google.client-id=1026229042300-qn7nfq0vs5ksqhbv6m9t808s1q2npcfe.apps.googleusercontent.com
  spring.security.oauth2.client.registration.google.client-secret=7qcOwKK8HPM8xmXBY3tmGBjh
  
  spring.security.oauth2.client.registration.github.client-id=e175eb2d8664fc986af8b3f8b069c405ab13ca1e
  spring.security.oauth2.client.registration.github.client-secret=487f160861fd0bf4ac75
  </code></pre>
  <p><strong>log</strong></p>
  <pre><code>Starting gleronn_db_1 ... done
  Creating cgleron      ... done
  Attaching to gleronn_db_1, cgleron
  db_1      | Error: Database is uninitialized and superuser password is not specified.
  db_1      |        You must specify POSTGRES_PASSWORD to a non-empty value for the
  db_1      |        superuser. For example, &quot;-e POSTGRES_PASSWORD=password&quot; on &quot;docker run&quot;.
  db_1      |
  db_1      |        You may also use &quot;POSTGRES_HOST_AUTH_METHOD=trust&quot; to allow all
  db_1      |        connections without a password. This is *not* recommended.
  db_1      |
  db_1      |        See PostgreSQL documentation about &quot;trust&quot;:
  db_1      |        https://www.postgresql.org/docs/current/auth-trust.html
  gleronn_db_1 exited with code 1
  cgleron   | 
  cgleron   |   .   ____          _            __ _ _
  cgleron   |  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
  cgleron   | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
  cgleron   |  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  cgleron   |   '  |____| .__|_| |_|_| |_\__, | / / / /
  cgleron   |  =========|_|==============|___/=/_/_/_/
  cgleron   |  :: Spring Boot ::                (v2.5.5)
  cgleron   |
  cgleron   | 2021-10-03 11:33:55.792  INFO 1 --- [           main] com.sprooTex.gleronn.GleronnApplication  : Starting GleronnApplication using Java 16.0.2 on c1a8793ee951 with PID 1 (/gleronn.jar started by root in /)
  cgleron   | 2021-10-03 11:33:55.795  INFO 1 --- [           main] com.sprooTex.gleronn.GleronnApplication  : No active profile set, falling back to default profiles: default
  cgleron   | 2021-10-03 11:33:56.880  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
  cgleron   | 2021-10-03 11:33:56.960  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 67 ms. Found 2 JPA repository interfaces.
  cgleron   | 2021-10-03 11:33:57.683  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
  cgleron   | 2021-10-03 11:33:57.699  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
  cgleron   | 2021-10-03 11:33:57.699  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.53]
  cgleron   | 2021-10-03 11:33:57.792  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
  cgleron   | 2021-10-03 11:33:57.792  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1876 ms
  cgleron   | 2021-10-03 11:33:57.990  INFO 1 --- [           main] o.f.c.internal.license.VersionPrinter    : Flyway Community Edition 7.7.3 by Redgate
  cgleron   | 2021-10-03 11:33:58.000  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
  cgleron   | 2021-10-03 11:34:09.066 ERROR 1 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.
  cgleron   |
  cgleron   | org.postgresql.util.PSQLException: The connection attempt failed.
  cgleron   |     at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:315) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.jdbc.PgConnection.&lt;init&gt;(PgConnection.java:223) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.Driver.makeConnection(Driver.java:465) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.Driver.connect(Driver.java:264) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at com.zaxxer.hikari.pool.HikariPool.&lt;init&gt;(HikariPool.java:115) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:54) ~[flyway-core-7.7.3.jar!/:na]
  cgleron   |     at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.&lt;init&gt;(JdbcConnectionFactory.java:69) ~[flyway-core-7.7.3.jar!/:na]
  cgleron   |     at org.flywaydb.core.Flyway.execute(Flyway.java:508) ~[flyway-core-7.7.3.jar!/:na]
  cgleron   |     at org.flywaydb.core.Flyway.migrate(Flyway.java:165) ~[flyway-core-7.7.3.jar!/:na]
  cgleron   |     at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:66) ~[spring-boot-autoconfigure-2.5.5.jar!/:2.5.5]
  cgleron   |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.5.jar!/:2.5.5]
  cgleron   |     at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.5.jar!/:2.5.5]
  cgleron   |     at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.5.jar!/:2.5.5]
  cgleron   |     at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.5.jar!/:2.5.5]
  cgleron   |     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.5.jar!/:2.5.5]
  cgleron   |     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.5.jar!/:2.5.5]
  cgleron   |     at com.sprooTex.gleronn.GleronnApplication.main(GleronnApplication.java:10) ~[classes!/:na]
  cgleron   |     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
  cgleron   |     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[na:na]
  cgleron   |     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
  cgleron   |     at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
  cgleron   |     at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[gleronn.jar:na]
  cgleron   |     at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[gleronn.jar:na]
  cgleron   |     at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[gleronn.jar:na]
  cgleron   |     at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[gleronn.jar:na]
  cgleron   | Caused by: java.net.UnknownHostException: db
  cgleron   |     at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567) ~[na:na]
  cgleron   |     at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:333) ~[na:na]
  cgleron   |     at java.base/java.net.Socket.connect(Socket.java:645) ~[na:na]
  cgleron   |     at org.postgresql.core.PGStream.createSocket(PGStream.java:231) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.core.PGStream.&lt;init&gt;(PGStream.java:95) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:98) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     ... 44 common frames omitted
  cgleron   |
  cgleron   | 2021-10-03 11:34:09.069  WARN 1 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/sp
  ringframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.exception.FlywaySqlException:
  cgleron   | Unable to obtain connection from database: The connection attempt failed.
  cgleron   | -------------------------------------------------------------------------
  cgleron   | SQL State  : 08001
  cgleron   | Error Code : 0
  cgleron   | Message    : The connection attempt failed.
  cgleron   |
  cgleron   | 2021-10-03 11:34:09.073  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
  cgleron   | 2021-10-03 11:34:09.093  INFO 1 --- [           main] ConditionEvaluationReportLoggingListener :
  cgleron   |
  cgleron   | Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
  cgleron   | 2021-10-03 11:34:09.114 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed
  cgleron   |
  cgleron   | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.except
  ion.FlywaySqlException:
  cgleron   | Unable to obtain connection from database: The connection attempt failed.
  cgleron   | -------------------------------------------------------------------------
  cgleron   | SQL State  : 08001
  cgleron   | Error Code : 0
  cgleron   | Message    : The connection attempt failed.
  cgleron   |
  cgleron   |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.5.jar!/:2.5.5]
  cgleron   |     at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.5.jar!/:2.5.5]
  cgleron   |     at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.5.jar!/:2.5.5]
  cgleron   |     at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.5.jar!/:2.5.5]
  cgleron   |     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.5.jar!/:2.5.5]
  cgleron   |     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.5.jar!/:2.5.5]
  cgleron   |     at com.sprooTex.gleronn.GleronnApplication.main(GleronnApplication.java:10) ~[classes!/:na]
  cgleron   |     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
  cgleron   |     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[na:na]
  cgleron   |     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
  cgleron   |     at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
  cgleron   |     at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[gleronn.jar:na]
  cgleron   |     at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[gleronn.jar:na]
  cgleron   |     at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[gleronn.jar:na]
  cgleron   |     at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[gleronn.jar:na]
  cgleron   | Caused by: org.flywaydb.core.internal.exception.FlywaySqlException:
  cgleron   | Unable to obtain connection from database: The connection attempt failed.
  cgleron   | -------------------------------------------------------------------------
  cgleron   | SQL State  : 08001
  cgleron   | Error Code : 0
  cgleron   | Message    : The connection attempt failed.
  cgleron   |
  cgleron   |     at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:68) ~[flyway-core-7.7.3.jar!/:na]
  cgleron   |     at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.&lt;init&gt;(JdbcConnectionFactory.java:69) ~[flyway-core-7.7.3.jar!/:na]
  cgleron   |     at org.flywaydb.core.Flyway.execute(Flyway.java:508) ~[flyway-core-7.7.3.jar!/:na]
  cgleron   |     at org.flywaydb.core.Flyway.migrate(Flyway.java:165) ~[flyway-core-7.7.3.jar!/:na]
  cgleron   |     at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:66) ~[spring-boot-autoconfigure-2.5.5.jar!/:2.5.5]
  cgleron   |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.10.jar!/:5.3.10]
  cgleron   |     ... 26 common frames omitted
  cgleron   | Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
  cgleron   |     at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:315) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.jdbc.PgConnection.&lt;init&gt;(PgConnection.java:223) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.Driver.makeConnection(Driver.java:465) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.Driver.connect(Driver.java:264) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at com.zaxxer.hikari.pool.HikariPool.&lt;init&gt;(HikariPool.java:115) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar!/:na]
  cgleron   |     at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:54) ~[flyway-core-7.7.3.jar!/:na]
  cgleron   |     ... 32 common frames omitted
  cgleron   | Caused by: java.net.UnknownHostException: db
  cgleron   |     at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567) ~[na:na]
  cgleron   |     at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:333) ~[na:na]
  cgleron   |     at java.base/java.net.Socket.connect(Socket.java:645) ~[na:na]
  cgleron   |     at org.postgresql.core.PGStream.createSocket(PGStream.java:231) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.core.PGStream.&lt;init&gt;(PGStream.java:95) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:98) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213) ~[postgresql-42.2.23.jar!/:42.2.23]
  cgleron   |     ... 44 common frames omitted
  cgleron   |
  cgleron exited with code 1
  </code></pre>