Is there a software for background and not more resource use

For many newer of docker, don’t know hot to make a servervice run background in dockerfile and not exit,so
is a service not pay more resource to run and can make container not exit?