Update WebIde config to accept ports
In order to implement #5276 we need several modifications on the Web ide configuration. We need to accept a
ports section in both the main image section and in each service one.
This is an example of the new
ports options in
terminal: image: name: alpine:3.9 ports: - 80 services: - name: tomcat alias: tomcat ports: - external_port: 8080 insecure: true - name: tomcat alias: tomcat2 ports: - external_port: 8080 internal_port: 80 name: main_port - external_port: 8081 name: secondary_port - name: tomcat alias: tomcat3 ports: - [8080, 80]
ports configuration can accept different options:
- Only one port. In this option the
internal_portis the same as the
ports: - 80
- An array of two values. In this option the first value is the external port and the second one the internal.
ports: - [80, 81]
A hash. The accepts the keys:
- If no
internal_portis set, the value of
external_portwill be used
- If no
ports: - external_port: 8080 internal_port: 8081 insecure: false name: port_name
By default all services are
insecure=false(which means that SSL is enabled)
Inside the same service, you can't have different ports pointing to the same external or internal port.
internal_portmust be unique within the configuration
If there is more than one service you are forced to set a port name.
If only one port is set,
default_portwill be used as the port name
When the proxy endpoint is requested you can use either the number or the name version of the port