port_mappings[]{container_port, service_port} 

(OPTIONAL)
The port exposed by a container, to be mapped to HTTP ports 80 and 443. Think of:

docker run -it -p 80:4000 -p 443:4000 ...

The following example exposes port 4000. From outside the service will be reachable at port 80 and 443:

{
  "domain": {
    "uri": "testing-testing.sloppy.zone"
  },
  "port_mappings": [
    {
      "container_port": 4000
    }
  ]
}

If you are running several apps within one project, you do not need to expose ports between apps (e.g. exposing the mysql port to the apache container).

Exposing TCP ports

In case you want to connect to an app directly via TCP (not using a domain and HTTP), you initially set the service_port  to 0 :

{
  "port_mappings": [
    {
      "container_port": 4000,
      "service_port": 0
    }
  ]
}

Once deployed, this service port will be replaced with an assigned port (in the range of 32001 to 60000. On further deployments, you'll have to replace the 0  with the generated port.

{
  "port_mappings": [
    {
      "container_port": 4000,
      "service_port": 32543
    }
  ]
}

Did this answer your question?