def _parse_ports(port_values: dict) -> dict:
        """Parse ports key.

        Args:
            port_values (dict): ports configuration values

        Returns:
            dict, Ports specification which contains exposed ports

        """
        # Initialising empty dictionary
        endpoints = {}

        for port_element in port_values:
            target_port = port_element.split(':')
            for port in target_port:
                endpoints[int(port)] = int(port)

        # Setting the types
        endpoint_spec = docker.types.EndpointSpec(ports=endpoints)
        return endpoint_spec