Em chào mọi người ạ. Em bị lỗi như ảnh khi run docker ạ .Nó ghi là:”Exception during pool initialization.
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.” . Mong mọi người chỉ em cách giải quyết ạ .Em cảm ơn .
Nguyễn HiếuBeginner
Run Docker trong spring boot
Share
Trong image của em đã có postgresql chưa, hay em đang connect với postgresql ở ngoài docker?
Em có thể share file Dockerfile được không em?
Để ý có 2 service là “database” và “server”, trong đó server sẽ start sau database, và kết nối đến db thông qua biến môi trường là DB_HOST: database
dạ vâng em cảm ơn anh ạ
1. Nhìn thế này có thể thấy em chưa include postgresql vào trong docker image rồi em ạ.
2. Em có thể theo hướng dẫn này để add thêm postgresql xem sao?
3. Lần tới post nội dung file thay vì chụp ảnh em nhé.
https://docs.docker.com/samples/postgresql_service/