dotnet publish solution excluding projects with tests

Ccumslvt1310/24/2022
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:

└───src
    ├───DemoApp.Publisher
    ├───DemoApp.Publisher.Tests
    ├───DemoApp.Shared
    ├───DemoApp.Worker
    └───DemoApp.Worker.Tests


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.
CCyberrex10/24/2022
publish DemoApp.Publisher and DemoApp.Worker individually
CCyberrex10/24/2022
the projects they reference will be included