appsody / stacks

Appsody application stacks. This repo will be archived soon.
https://appsody.dev
Apache License 2.0
90 stars 120 forks source link

appsody deploy picks the APPSODY_PORT from the config of the stack image instead of the application image #483

Open henrynash opened 4 years ago

henrynash commented 4 years ago

When appsody deploy modifies the app-config.yaml, it has to pick a port to assign to APPSODY_PORT. Today it does this by examine the env variables in the stack image. This seems dangerous to me - for instance you may have different ports (for debugging purposes) exposed in Dockerfile-stack that you do not have in your final application image. This was the problem that caused issue: #461

You can demonstrate this by setting different ports in Dockerfile-stack and running appsody deploy --generate-only and inspecting the app-config.yaml file.

imho, Appsody deploy should pick the ports based on those exposed by the built application image, not the stack image.

skoh7645 commented 4 years ago

@henrynash Do you mean the CLI should look for the ports exposed in Dockerfilerather than theDockerfile-stack`?

henrynash commented 4 years ago

@skoh7645 Essentially yes. In fact what deploy does in run a docker inspect on the stack image, extract the Config section and parse it for the ports. So I am saying we should be inspecting the final application image (which is built using Dockerfile, not Dockerfile-stack) to parse for ports.