Webviewer Server Docker on Heroku - Setting PORT at Runtime

Product: Webviewer Server

Product Version: pdftron/webviewer-server:1.5.8

Please give a brief summary of your issue:
(Think of this as an email subject)
Heroku assigns ports dynamically at runtime. PDFTron webviewer server exposes a fixed port, 8090. Would appreciate any advice or suggestions on how to dynamically configure the webviewer server port.

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
Heroku states:
https://help.heroku.com/PPBPA231/how-do-i-use-the-port-environment-variable-in-container-based-apps

When deploying a container app on Heroku, we require that Dockerfiles are configured to intake the randomly assigned port on a dyno - exposed as the $PORT environmental variable.

However Webviewer Server only exposes 8090:
https://hub.docker.com/layers/pdftron/webviewer-server/1.5.8/images/sha256-742cbc3536e813f753ed3d407dd212fc47274cc054bc3776e3a760298c73fdba?context=explore

We’re currently using socat to forward connections to port 8090 but would appreciate any suggestions on how to dynamically configure the port

Please provide a link to a minimal sample where the issue is reproducible:

1 Like

Hi Alex,

I spoke with our WVS developer unfortunately there is no way to dynamically configure the port at runtime.
The port can be configured in the following file within the docker container /usr/local/apache-tomcat/conf/server.xml.
If the port that will be set is available prior to starting the docker container, then you could create your own modified version of the docker container overwriting that file with a copy using the new port.

Ex:

FROM pdftron/webviewer-server:1.5.8
COPY server.xml /usr/local/apache-tomcat/conf/server.xml

Please let me know if there are any issues.

Best Regards,
Ahmad Moaaz
Software Developer
PDFTron Systems, Inc.
www.pdftron.com