Возникает exception в postgres (Connection to localhost:5432 refused) в Докере
Начал свое знакомство с Docker и на примере туториола хотел запустить приложение. Возникла ошибка:
org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Dockerfile
FROM openjdk:8
ADD target/disk-sharing-app-0.0.1-SNAPSHOT.jar disk-sharing-app-0.0.1-SNAPSHOT.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "disk-sharing-app-0.0.1-SNAPSHOT.jar"]
docker-compose.yml
version: '3.1'
services:
app:
container_name: app-springboot-postgresql
image: app-springboot-postgresql
build: ./
ports:
- "8080:8080"
depends_on:
- dbpostgresql
dbpostgresql:
image: postgres
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=1234
- POSTGRES_USER=postgres
- POSTGRES_DB=ProjectDB
application.properties
## PostgreSQL
spring.datasource.url=jdbc:postgresql://localhost:5432/ProjectDB
spring.datasource.username=postgres
spring.datasource.password=1234
## Hibernate
spring.jpa.show-sql=true
logging.level.org.hibernate.SQL=debug
logging.level.org.hibernate.type.descriptor.sql=trace
#drop n create table again, good for testing, comment this in production
spring.jpa.hibernate.ddl-auto=create
Запускаю с помощью этой команды:
docker-compose up --build
Ну и полный лог:
Creating network "disksharingapp_default" with the default driver
Building app
Step 1/4 : FROM openjdk:8
---> db530b5a3ccf
Step 2/4 : ADD target/disk-sharing-app-0.0.1-SNAPSHOT.jar disk-sharing-app-0.0.1-SNAPSHOT.jar
---> Using cache
---> 4b7a7b2071ac
Step 3/4 : EXPOSE 8080
---> Using cache
---> 787505fb0279
Step 4/4 : ENTRYPOINT ["java", "-jar", "disk-sharing-app-0.0.1-SNAPSHOT.jar"]
---> Using cache
---> f9b8770df756
Successfully built f9b8770df756
Successfully tagged app-springboot-postgresql:latest
Creating disksharingapp_dbpostgresql_1 ... done
Creating app-springboot-postgresql ... done
Attaching to disksharingapp_dbpostgresql_1, app-springboot-postgresql
dbpostgresql_1 | The files belonging to this database system will be owned by user "postgres".
dbpostgresql_1 | This user must also own the server process.
dbpostgresql_1 |
dbpostgresql_1 | The database cluster will be initialized with locale "en_US.utf8".
dbpostgresql_1 | The default database encoding has accordingly been set to "UTF8".
dbpostgresql_1 | The default text search configuration will be set to "english".
dbpostgresql_1 |
dbpostgresql_1 | Data page checksums are disabled.
dbpostgresql_1 |
dbpostgresql_1 | fixing permissions on existing directory /var/lib/postgresql/data ... ok
dbpostgresql_1 | creating subdirectories ... ok
dbpostgresql_1 | selecting dynamic shared memory implementation ... posix
dbpostgresql_1 | selecting default max_connections ... 100
dbpostgresql_1 | selecting default shared_buffers ... 128MB
dbpostgresql_1 | selecting default time zone ... Etc/UTC
dbpostgresql_1 | creating configuration files ... ok
dbpostgresql_1 | running bootstrap script ... ok
dbpostgresql_1 | performing post-bootstrap initialization ... ok
dbpostgresql_1 | syncing data to disk ... ok
dbpostgresql_1 |
dbpostgresql_1 |
dbpostgresql_1 | Success. You can now start the database server using:
dbpostgresql_1 |
dbpostgresql_1 | pg_ctl -D /var/lib/postgresql/data -l logfile start
dbpostgresql_1 |
dbpostgresql_1 | initdb: warning: enabling "trust" authentication for local connections
dbpostgresql_1 | You can change this by editing pg_hba.conf or using the option -A, or
dbpostgresql_1 | --auth-local and --auth-host, the next time you run initdb.
dbpostgresql_1 | waiting for server to start....2020-10-03 08:34:58.660 UTC [46] LOG: starting PostgreSQL 13.0 (Debian 13.0-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
dbpostgresql_1 | 2020-10-03 08:34:58.664 UTC [46] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
dbpostgresql_1 | 2020-10-03 08:34:58.683 UTC [47] LOG: database system was shut down at 2020-10-03 08:34:58 UTC
dbpostgresql_1 | 2020-10-03 08:34:58.690 UTC [46] LOG: database system is ready to accept connections
dbpostgresql_1 | done
dbpostgresql_1 | server started
dbpostgresql_1 | CREATE DATABASE
dbpostgresql_1 |
dbpostgresql_1 |
dbpostgresql_1 | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
dbpostgresql_1 |
dbpostgresql_1 | 2020-10-03 08:34:58.927 UTC [46] LOG: received fast shutdown request
dbpostgresql_1 | waiting for server to shut down....2020-10-03 08:34:58.932 UTC [46] LOG: aborting any active transactions
dbpostgresql_1 | 2020-10-03 08:34:58.935 UTC [46] LOG: background worker "logical replication launcher" (PID 53) exited with exit code 1
dbpostgresql_1 | 2020-10-03 08:34:58.935 UTC [48] LOG: shutting down
dbpostgresql_1 | 2020-10-03 08:34:58.961 UTC [46] LOG: database system is shut down
dbpostgresql_1 | done
dbpostgresql_1 | server stopped
dbpostgresql_1 |
dbpostgresql_1 | PostgreSQL init process complete; ready for start up.
dbpostgresql_1 |
app-springboot-postgresql |
app-springboot-postgresql | . ____ _ __ _ _
app-springboot-postgresql | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
app-springboot-postgresql | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
app-springboot-postgresql | \\/ ___)| |_)| | | | | || (_| | ) ) ) )
app-springboot-postgresql | ' |____| .__|_| |_|_| |_\__, | / / / /
app-springboot-postgresql | =========|_|==============|___/=/_/_/_/
app-springboot-postgresql | :: Spring Boot :: (v2.3.3.RELEASE)
app-springboot-postgresql |
dbpostgresql_1 | 2020-10-03 08:34:59.071 UTC [1] LOG: starting PostgreSQL 13.0 (Debian 13.0-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
dbpostgresql_1 | 2020-10-03 08:34:59.071 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
dbpostgresql_1 | 2020-10-03 08:34:59.071 UTC [1] LOG: listening on IPv6 address "::", port 5432
dbpostgresql_1 | 2020-10-03 08:34:59.090 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
dbpostgresql_1 | 2020-10-03 08:34:59.101 UTC [64] LOG: database system was shut down at 2020-10-03 08:34:58 UTC
dbpostgresql_1 | 2020-10-03 08:34:59.108 UTC [1] LOG: database system is ready to accept connections
app-springboot-postgresql | 2020-10-03 08:34:59.253 INFO 1 --- [ main] r.a.d.DiskSharingAppApplication : Starting DiskSharingAppApplication v0.0.1-SNAPSHOT on c3a5a48ce4fc with PID 1 (/disk-sharing-app-0.0.1-SNAP
SHOT.jar started by root in /)
app-springboot-postgresql | 2020-10-03 08:34:59.256 INFO 1 --- [ main] r.a.d.DiskSharingAppApplication : No active profile set, falling back to default profiles: default
app-springboot-postgresql | 2020-10-03 08:35:00.487 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode.
app-springboot-postgresql | 2020-10-03 08:35:00.622 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 121ms. Found 4 JPA repository interfaces.
app-springboot-postgresql | 2020-10-03 08:35:01.651 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
app-springboot-postgresql | 2020-10-03 08:35:01.666 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
app-springboot-postgresql | 2020-10-03 08:35:01.666 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.37]
app-springboot-postgresql | 2020-10-03 08:35:01.739 INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
app-springboot-postgresql | 2020-10-03 08:35:01.739 INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2384 ms
app-springboot-postgresql | 2020-10-03 08:35:02.034 INFO 1 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
app-springboot-postgresql | 2020-10-03 08:35:02.267 INFO 1 --- [ task-1] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
app-springboot-postgresql | 2020-10-03 08:35:02.368 WARN 1 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view ren
dering. Explicitly configure spring.jpa.open-in-view to disable this warning
app-springboot-postgresql | 2020-10-03 08:35:02.886 INFO 1 --- [ task-1] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.20.Final
app-springboot-postgresql | 2020-10-03 08:35:03.007 INFO 1 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManager
IntegrationFilter@58d75e99, org.springframework.security.web.context.SecurityContextPersistenceFilter@2b91004a, org.springframework.security.web.header.HeaderWriterFilter@6da21078, org.springframework.security.web.authentication.log
out.LogoutFilter@611889f4, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@7c24b813, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@22ef9844, org.springframew
ork.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@74751b3, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@21e360a, org.springframework.security.web.savedrequest.RequestCacheAwareFilt
er@2fb3536e, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@7205765b, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@741a8937, org.springframework.security.web.sess
ion.SessionManagementFilter@4229bb3f, org.springframework.security.web.access.ExceptionTranslationFilter@28f2a10f, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@f5acb9d]
app-springboot-postgresql | 2020-10-03 08:35:03.209 INFO 1 --- [ task-1] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
app-springboot-postgresql | 2020-10-03 08:35:03.603 INFO 1 --- [ task-1] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
app-springboot-postgresql | 2020-10-03 08:35:03.751 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
app-springboot-postgresql | 2020-10-03 08:35:03.754 INFO 1 --- [ main] DeferredRepositoryInitializationListener : Triggering deferred initialization of Spring Data repositories…
app-springboot-postgresql | 2020-10-03 08:35:04.684 ERROR 1 --- [ task-1] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
app-springboot-postgresql |
app-springboot-postgresql | org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
app-springboot-postgresql | at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:285) ~[postgresql-42.2.14.jar!/:42.2.14]
app-springboot-postgresql | at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.2.14.jar!/:42.2.14]
app-springboot-postgresql | at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:217) ~[postgresql-42.2.14.jar!/:42.2.14]
app-springboot-postgresql | at org.postgresql.Driver.makeConnection(Driver.java:458) ~[postgresql-42.2.14.jar!/:42.2.14]
app-springboot-postgresql | at org.postgresql.Driver.connect(Driver.java:260) ~[postgresql-42.2.14.jar!/:42.2.14]
app-springboot-postgresql | at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-3.4.5.jar!/:na]
app-springboot-postgresql | at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:358) ~[HikariCP-3.4.5.jar!/:na]
app-springboot-postgresql | at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-3.4.5.jar!/:na]
app-springboot-postgresql | at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:477) [HikariCP-3.4.5.jar!/:na]
app-springboot-postgresql | at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:560) [HikariCP-3.4.5.jar!/:na]
app-springboot-postgresql | at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) [HikariCP-3.4.5.jar!/:na]
app-springboot-postgresql | at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) [HikariCP-3.4.5.jar!/:na]
app-springboot-postgresql | at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180) [hibernate-core-5.4.20.Final.jar!/:5.4.20.
Final]
app-springboot-postgresql | at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:68) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:176) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:118) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1224) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1255) [hibernate-core-5.4.20.Final.jar!/:5.4.20.Final]
app-springboot-postgresql | at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) [spring-orm-5.2.8.RELEASE.jar!/:5.2.8.REL
EASE]
app-springboot-postgresql | at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) [spring-orm-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
app-springboot-postgresql | at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391) [spring-orm-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
app-springboot-postgresql | at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_265]
app-springboot-postgresql | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_265]
app-springboot-postgresql | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_265]
app-springboot-postgresql | at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_265]
app-springboot-postgresql | Caused by: java.net.ConnectException: Connection refused (Connection refused)
app-springboot-postgresql | at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_265]
app-springboot-postgresql | at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_265]
app-springboot-postgresql | at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_265]
app-springboot-postgresql | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_265]
app-springboot-postgresql | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_265]
app-springboot-postgresql | at java.net.Socket.connect(Socket.java:607) ~[na:1.8.0_265]
app-springboot-postgresql | at org.postgresql.core.PGStream.<init>(PGStream.java:81) ~[postgresql-42.2.14.jar!/:42.2.14]
app-springboot-postgresql | at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:93) ~[postgresql-42.2.14.jar!/:42.2.14]
app-springboot-postgresql | at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197) ~[postgresql-42.2.14.jar!/:42.2.14]
app-springboot-postgresql | ... 34 common frames omitted
app-springboot-postgresql |
app-springboot-postgresql | 2020-10-03 08:35:04.685 WARN 1 --- [ task-1] o.h.e.j.e.i.JdbcEnvironmentInitiator : HHH000342: Could not obtain connection to query metadata : Connection to localhost:5432 refused. Check that
the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
app-springboot-postgresql | 2020-10-03 08:35:04.695 WARN 1 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans
.factory.BeanCreationException: Error creating bean with name 'diskRepository' defined in ru.ayubdzhanov.disksharingapp.dao.spring.data.DiskRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaR
epositoriesConfiguration: Cannot resolve reference to bean 'jpaMappingContext' while setting bean property 'mappingContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'jpaMappingContext': Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
app-springboot-postgresql | 2020-10-03 08:35:04.698 INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
app-springboot-postgresql | 2020-10-03 08:35:04.698 WARN 1 --- [ main] o.s.b.f.support.DisposableBeanAdapter : Invocation of destroy method failed on bean with name 'entityManagerFactory': org.hibernate.service.spi.Ser
viceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
app-springboot-postgresql | 2020-10-03 08:35:04.699 INFO 1 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
app-springboot-postgresql | 2020-10-03 08:35:04.713 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
app-springboot-postgresql | 2020-10-03 08:35:04.737 INFO 1 --- [ main] ConditionEvaluationReportLoggingListener :
app-springboot-postgresql |
app-springboot-postgresql | Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
app-springboot-postgresql | 2020-10-03 08:35:04.742 ERROR 1 --- [ main] o.s.boot.SpringApplication : Application run failed
app-springboot-postgresql |
app-springboot-postgresql | org.springframework.beans.factory.BeanCreationException: Error creating
Ответы (1 шт):
Please share output for docker inspect postgresql command. You will see the host ip for docker postgresql service and need to put in the same host in application properties rather than localhost. The service is not exposed on localhost. Please confirm if you are able to connect to postgresql using pgadmin.
Вольный перевод на русский:
Пожалуйста, добавьте в вопрос вывод проверки команды postgresql. Вы увидите host ip для службы docker postgresql и должны будете прописать такой же host ip в свойствах приложения вместо localhost. Эта служба не доступна (выставлена) на локальном сервере. Пожалуйста, скажите, можете ли Вы подключится к postgresql с помощью pgadmin