Latency is a critical aspect for a broad spectrum of applications that relies on the internet, such as, voice over IP (VoIP) or teleconferencing, and the lack of ultra-fast and highly reliable communications is prominent in rural areas even in mature economies. Our proposal focuses on optimizing the deployment of microservice-oriented architectures (MSA) in computing and routing enabled unmanned aerial vehicles (UAVs). For that matter, an information system which gathers all the information of the flying ad hoc network (FANET) is developed. From there, we propose multiple approaches, based on integer linear programming (ILP) and heuristics, to tackle the minimization of end-to-end latency by deploying multiple instances of microservices in the UAVs that are close to the users that make use of them. Extensive experiments based on network emulation prove the performance of our ILP formulation of the problem and address the optimality gap between the ILP-based approach and the heuristics ones, which are highly scalable and usable in real-time for large-scale scenarios.