Приложение использует базу данных Postgres, которая работает на моем локальном компьютере.
Это тот шаг, который я сделал
application.properties
Код: Выделить всё
spring.datasource.url= jdbc:postgresql://localhost:5432/TechDB
spring.datasource.username= myuser
spring.datasource.password= mypass
Код: Выделить всё
FROM openjdk:22
LABEL maintainer="myself"
ADD target/AppToTest-1.0-SNAPSHOT.jar AppToTest.jar
ENTRYPOINT ["java", "-jar", "AppToTest.jar"]
Код: Выделить всё
docker build -t apptotest:latest .
Код: Выделить всё
docker run -p 8000:8080 apptotest
Код: Выделить всё
[nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 08001
[nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Подробнее здесь: https://stackoverflow.com/questions/789 ... postgres-d