Cloud and fog computing environments are essential for latency-sensitive applications, especially in scenarios where processing needs to occur in a distributed manner and close to end users. However, dynamic variations in workload make it difficult to meet Service Level Agreements (SLAs), as demand can fluctuate over time and rapidly alter the level of resources needed to maintain expected performance. In this context, static or purely reactive allocation strategies can result in both SLA violations and over-provisioning, increasing operational costs and reducing the utilization of available resources. This dissertation proposes FC-DT, a Digital Twin (DT) based on Stochastic Petri Nets (SPNs) for predictive and dynamic resource management in cloud-fog environments. The SPN provides a formal basis for representing and simulating the stochastic dynamics of the system, including variations in load, resource usage, response times, and potential bottlenecks between layers. Leveraging this analytical capability, FC-DT incorporates a proactive decision-making mechanism that runs simulations of alternative scenarios at runtime, allowing for the evaluation of different configurations before performance degradation occurs. Based on the results of these simulations, FC-DT adjusts resource allocation in a coordinated manner between the fog and cloud layers, anticipating potential SLA violations and maintaining only the minimum configuration necessary for compliance. In this way, the approach seeks to balance performance and rational resource use, avoiding both shortages during peak times and the unnecessary maintenance of idle instances. Experimental results show that the approach ensures SLA compliance even under peak loads, reducing average resource usage by 29.65% compared to a minimum static configuration required to meet the SLA.