Emerging compute-intensive and latency-sensitive vehicular applications are expected to be deployed at the edge instead of the cloud to shorten the network latency. Mobile fog nodes carried by moving vehicles have been proposed to complement the stationary fog nodes co-located with base stations to handle the spatio-temporal variations of the demand in a cost-efficient way. Existing works on capacity planning for such vehicular fog computing (VFC) scenarios assume that the vehicular traffic follows certain spatio-temporal patterns, which may change in different seasons, and create capacity plans accordingly. In other words, they consider long-term capacity planning, leaving the adaptation to temporary changes or unexpected variations out of scope. In this work, we propose an integer linear programming (ILP) based framework to optimize the routing strategy of vehicular fog nodes (VFNs) in order to maximize the profit received by the service provider, taking into account the quality of service (QoS) received by the users and service level agreement (SLA) of various applications. To adapt to the temporal variations in demand, we predict the traffic flow and resource consumption from the users with feedback from service evaluation. To reduce the computational time and enable parallel processing, we create the capacity plan in two steps, namely global planning and regional planning. Through simulations, we show that the proposed solution achieves an 85% higher profit and a 20% higher service rate compared to the strategy where the VFNs randomly travel and serve the surrounding users without demand prediction. It achieves similar network latency compared to the strategy using only stationary fog nodes, but with a higher cost-efficiency. We also evaluate the impacts of number of VFNs, cost parameters, and regional size on the capacity plan. We find that a high number of VFNs, a small regional size, a high penalty cost, and low traveling and rental costs will lead to a high service rate; while a large regional size and low traveling, rental, and penalty costs will result in a high profit.