docker-compose memory and CPU limit

I know that in the Synology Container Manager I can set the CPU priority and memory limit for a container. I also understood that the Synology Kernel is too old to support resource limits and reservations of the docker-compose definition.

What I do not understand is how set in the docker-compose the same CPU priority and memory limit that is indeed possible to set through the UI.

I have seen people setting the cpu_shares property in the Docker compose to set the CPU priority in some way. This looks like it is working since in the Container Manager UI the CPU Mid priority is not selected anymore.

Now I wonder how to do the same with the Memory Limit. Did someone manage this?