I ended up fixing this problem by staying away from postgres:17-alpine. Instead just used postgres:17 image and everything works fine now.