Portugal has a mild-to-hot climate, which is perfect for growing a myriad of wonderful produce, like figs, avocados, plums, melons, and clementines. On the Portuguese islands, Madeira and Açores, pineapples and bananas grow, that you can simply collect from the trees while hiking (if you can manage to climb!).
There are many inexpensive frutarias (fruit shops) throughout all major cities in Portugal, which sell locally-grown fresh fruit, seasonal nuts, dried beans, and sometimes a few other items, all at very modest affordable prices. It's possible that these shops could throw things away, but the turnover of what gets sold is so high that many simply run out of everything by the end of the day. Others simply lower the prices of less-than-perfect fruits and vegetables and continue selling them.
Similar to these small shops are much larger farmers' markets, like Bolhão, a covered market in central Porto. You might have more success trying to dumpster around closing time (4 PM-ish), simply by asking the vendors (in Portuguese!) if they have anything to throw away. While the vendors may be kind and understanding, many urban Portuguese care a lot about social status and might not want to be seen with you while you ask this, unless they are really alternative or simply don't care about their image. They'll say that fruit is so cheap throughout the country that they can't be bothered not to pay for it, and support their hard-working farmers.
It's also fairly universal that outside of cities, most homes have extensive gardens or farms through which they can be self-sufficient. Many produce their own wine, olive oil, and honey, as well.
Aldi works quite good for dumpsterdiving in Portugal.