Preheat your oven to 375°F (190°C).
In a saucepan, heat the olive oil over medium heat. Add the flour and stir constantly for about 2 minutes.
Gradually whisk in the almond milk, making sure there are no lumps. Cook until the mixture thickens, about 5-7 minutes.
Add the salt, pepper, and garlic powder to the sauce. Stir well.
Layer half of the sliced potatoes in a greased baking dish. Top with half of the chopped onions. Pour half of the sauce over the potatoes and onions.
Repeat the layers with the remaining potatoes, onions, and sauce.
Cover the baking dish with aluminum foil and bake for 30 minutes. Remove the foil and bake for an additional 30 minutes, or until the potatoes are tender and the top is golden brown.
Let the dish cool for a few minutes before serving.