There are a few ways to achieve this.
The simplest way is to create a RAM disk at computer startup. This typically occurs long before the Service Control Manager begins starting services, so the RAM disk is available for them to use.
Alternatively, if you are creating a very large RAM disk (for example, hundreds of gigabytes), it may take longer to initialise. In this case, you can configure the service to use a delayed automatic start, which will allow sufficient time for the RAM disk to be created.