Wash the celeriac slices to remove any excess starch and then dry thoroughly.
In the meantime, heat the oil in a wide saute pan and add the sliced onions and garlic. Cook over a low heat until they become soft and sweet. This will take approximately 30 minutes or so. Remove with a slotted spoon and drain off any excess oil.
Grease the gratin dish with the butter and arrange a layer of the celeriac slices. Sprinkle over some of the onion mixture with some chilli flakes and cinnamon, then continue to layer until you have used up all the ingredients.
Mix together the cream and milk and season well with salt and pepper, and pour over the celeriac. Cover with foil and place in a preheated oven at 175°C. Cook until tender. This will take approximately 45 minutes to an hour. Remove the foil ten minutes before the end of cooking to allow the top to brown.
If cooking from frozen, bake for 45 minutes and then allow to cool completely. Divide into portions and transfer to a freezer-safe container to cook from frozen later. When cooking from frozen, place the gratin into a baking dish and bake in a preheated oven at 160°C until tender and golden, about 20-25 minutes.