Running application within Docker containers

If someone may know, does it need to be separate Dockerfile for a database and service itself in case if you want to run an application within Docker containers?

It’s not quite clear where to specify the external database and server name, is it in the .env file?
https://github.com/gurock/testrail-docker/blob/master/README.md
http://docs.gurock.com/testrail-admin/installation-docker/migrating-upgrading-testrail

Source: StackOverflow