Based on these error messages:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
[...]
ModuleNotFoundError: No module named 'torch'

I would guess that your current setup might be mixing different Python versions (or environments) and thus breaks in Py_Initialize and cannot find torch.
Look through the build logs of your container and check if some pre-installed packages are uninstalled etc.