November 5, 20223 yr Is it possible to set the conatiner port dynamically? I have a container running on ports 8095 and 40123 by default. I can change this via 2 variables (but this also affects the server, so the container ports would have to be changed as well) What I mean as command Default: docker run -p 8095:8095 -p 40123:40123 ... With modified ports: docker run --env WEB_PORT=1234 --env=API_PORT=4321 -p 1234:1234 -p 4321:4321 ... How can I set this dynamically in the config?
November 5, 20223 yr Community Expert Don't understand what you are trying to do that is different than docker port mapping
November 5, 20223 yr Author How can I configure "Container Port" with the corresponding variable and its Default Value For example: Variable WEB_PORT = 8095 (Default, can be changed) Container Port = $WEB_PORT (Changes automatically when variable is changed)
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.