Re: build client application running in container or pod
Have a look at trader-typescript, a much improved version of using the Gateway Client to interact with the ledger.
When connecting to the gateway, it is preferred to set up a gateway service alias, which can be used to connect and load balance across peers in an org.
This sample sets up the correct patterns for working with the ledger. It needs a Docker build example, but should be straightforward to prepare a container as a simple node application. When running in k8s the env can be set up to refer to secret volume mounts, etc. to pass in the correct user context as local files mounted in the pod.