dotnet publish solution excluding projects with tests

Is it possible to publish solution and exclude projects with tests?

I have the following project structure and docker image doesn't actually need those *.Tests projects to be published:


Also, is it a good idea to build single docker image instead of two separate ones? DemoApp.Publisher and DemoApp.Worker are meant to be standalone apps.
publish DemoApp.Publisher and DemoApp.Worker individually
the projects they reference will be included