Prevent container autoclosing

Hey all, I’m building a custom image and was wondering if there’s a way to prevent the container autoclosing when running the -d flag if a certain program is running.

I can run the container with the -i combined with the -d flag but is there a better way of configuring the image?

Thanks