In Edge and Fog Computing environments, it is usual to design and test distributed algorithms that implement scheduling and load balancing solutions. The operation paradigm that usually fits the context requires the users to make calls to the closer node for executing a task, and since the service must be distributed among a set of nodes, the serverless paradigm with the FaaS (Function-as-a-Service) is the most promising strategy to use. In light of these preconditions, we designed and implemented a framework called P2PFaaS. The framework, built upon Docker containers, allows the implementation of fully decentralised scheduling or load balancing algorithms among a set of nodes. By relying on three basic services, such as the scheduling service, the discovery service, and the learner service, the framework allows the implementation of any kind of scheduling solution, even if based on Reinforcement Learning. Finally, the framework provides a ready-to-go solution that can be installed and has been tested both on x86 servers and ARM-based edge nodes (like, for example, the Raspberry Pi).