Containers are supposed to be throwaway; if you need to change something inside, you rebuild it from scratch and redeploy.
Hopefully, your data should not be throwaway. The common architecture is to have an application server inside container that connects to database or other persistent storage running outside containers.