It would be really hard to deploy “just the api” just because of how DHIS2 is packaged. However, the net resource benefit of having an API alone is minimal since the “frontend” is composed of react apps that are light and utilize the API for their functionality
That being said, have a look at docker hub and see what images you can find there