Risk-Based Constraints for the Optimal Operation of an Energy Community