Hello, kabayan! It is indeed frustrating when spices lose their potency. For real tips, first consider where you buy your spices. Always get them from a place with high turnover, so they are fresh from the start, no?
For containers, airtight glass jars are best, especially if they are dark-colored. Light is the enemy, like direct sun on your plants! If you have clear jars, put them inside a dark cabinet or pantry. This keeps the aroma locked in. Do not use plastic, as it can absorb the oils.
Regarding temperature, a cool, dry place is ideal. Away from the stove and any appliances that generate heat. The constant heat will diminish their flavor quickly. Some people say refrigerate, but for most ground spices, this can introduce moisture and clumpiness, making them spoil faster. Whole spices might be different, but for everyday use, just a cool, dry pantry is good.
Also, try to buy whole spices and grind them yourself as needed. This is how we do it for some of our traditional dishes, it makes a big difference! They retain their potency much longer. Good luck with your cooking, friend!