Single db instance with multiple apps

yes, it is better to separate the database from the apps. One option is to create the apps and database to the same overlay network. You could create a new overlay network or use docker ingress overlay network. for example,

  1. create an overlay network, docker network create -d overlay mynet.

  2. create the database service, docker service create --name mydb --network mynet --replicas 1 dbimage.

  3. create the app service, docker service create --name app1 --network mynet --replicas 1 myapp1. myapp1 could talk with db by the dns name mydb.

For DB, you would need to consider where data is stored, as container could move from one node to another. Could refer to question How does Docker Swarm handle database (PostgreSQL) replication?