Given a project that there are five microservices, is there any way to make four private and just one public?

Given four applications into a single project that will work as microservices:

    id: conference
    type: upstream
    upstream: "conference:http"

    id: session
    type: upstream
    upstream: "session:http"

    id: speaker
    type: upstream
upstream: "speaker:http"

  type: upstream
  upstream: "app:http"

How can we make some resources as private? I mean, how can I make that all services internally communicate via HTTP, but just the app accesses publicly?

There is no need to make an application container public. If it’s not listed in routes.yaml then it will not be accessible to the outside world at all.

Instead, to have applications talk to each other add the relationship to the application that wants to initiate the connection. For example, to have the app application in the example above talk to the speakers application, add the following to the app instance’s file:

    speaker: speaker:http

Then you can consult the PLATFORM_RELATIONSHIPS environment variable for the domain name to use to send messages to that application. Omit the speaker application from routes.yaml entirely.

That is preferable to exposing each application on its own public URL just so that it can be accessed from another application.

Note that circular relationships are not supported, so you cannot have two applications that refer to each other in their relationships blocks. Only the “sending” side of the connection needs to have a relationship defined.