A loki with minimum retention time

I have multiple servers generating a large volume of logs, and they are configured with Promtail to send these logs to a Loki server. On my Loki server, I have an hourly cronjob that retrieves data from the Loki API and stores the necessary logs in a database. Since I only require logs that are up to one hour old, I have been attempting to set a retention time of 24 hours or less. However, my attempts have been unsuccessful so far. I am using the filesystem as storage and running Loki as a Docker container, which means I have to kill the container and rebuild it in order to remove older data. Could someone provide me with a Loki configuration file that meets my requirements?