Commit 53712709 authored by Daniele Venzano's avatar Daniele Venzano

Add option in the app description to expose ports on docker hosts

parent 97ed2fd9
......@@ -105,6 +105,10 @@ class PlatformManager:
raise ZoeException("cannot find variable to substitute in expression {}".format(env_value))
copts.add_env_variable(env_name, env_value)
for p in service_description.ports:
if p.expose:
copts.ports.append(p.port_number) # FIXME UDP ports?
for path, mountpoint, readonly in service_description.volumes:
copts.add_volume_bind(path, mountpoint, readonly)
......
......@@ -100,6 +100,7 @@ class ServiceEndpointDescription:
self.port_number = 0
self.path = ''
self.is_main_endpoint = False
self.expose = False
def to_dict(self):
d = {
......@@ -107,7 +108,8 @@ class ServiceEndpointDescription:
'protocol': self.protocol,
'port_number': self.port_number,
'path': self.path,
'is_main_endpoint': self.is_main_endpoint
'is_main_endpoint': self.is_main_endpoint,
'expose': self.expose
}
return d
......@@ -132,6 +134,9 @@ class ServiceEndpointDescription:
if 'path' in data:
self.path = data['path']
if 'expose' in data:
self.expose = data['expose']
def get_url(self, address):
return self.protocol + "://" + address + ":{}".format(self.port_number) + self.path
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment