Note that sharing only code and writing about the issue only in title will not attract many people to help. I checked the code anyway and I guess you are using a volume in Kubernetes so even if you replace the image, the old volume will be mounted with the old ownership. First you should try running a container from the newly built image locally without volumes and check the permissions there.
One other wy could be if the service inside the container “fixes” the permissions while starting the container.
I can’t think of ny other way right now.
PS.: I removed the other topic with the same content. The spam filter blocked this one until I allowed it.