Once you have an application running via Panamax, you can always create a template for that application so it can easily be recreated via another Panamax client. This is powerful concept for a development workflow, but can fall short when you just want to share an application running on your development machine with a colleague, or demo an application with a client.
Normally, making your application publicly accessible would require deploying to a server, but there is another option. Using a great open-source project called ngrok, you can quickly and securely expose a local web server to the Internet. Even better, you can do so by simply adding a temporary ngrok container to your existing application in Panamax.
ngrok - Introspected tunnels to localhost
ngrok is a great open source project by Alan Shreve and is also available as a service at ngrok.com. At its base, ngrok is a reverse proxy that creates a secure tunnel between a public Internet-accessible endpoint to a locally running web service.
Using an ngrok container in Panamax
Here at CenturyLink Labs we’ve recently built many different Docker images, including a ngrok image centurylink/ngrok which is highly leveraged from an image that Fletcher Nichol originally created: fnichol/ngrok. This image is great as it is very lightweight and will download quickly at slightly over 20mb.
Lets walk through how we would add this image and configure it within an existing Panamax application. Let's use a simple Wordpress template as our example.
Now from within the Application Detail page, click +Add a Service and search centurylink/ngrok:
I added the ngrok service to the 'Web' category, but you can add it anywhere -- including creating a new category for it.
Next we need to configure the environment variables for the ngrok service. Click the service name to go to the ngrok service details page. In the Environmental Variables section, add a new variable key
HTTP_PORT with you
localhost IP:port as the value.
NOTE: The port value is the port number you setup in VirtualBox to be forwarded to reach the Wordpress GUI. Hit the Save All Changes button. This will trigger a rebuild of the app.
As the App is rebuilding, watch the Activity log and make note of the public internet url is assigned:
[INFO] [client] Tunnel established at http://1af9484.ngrok.com
Now you can share that url,
http://1af9484.ngrok.com in our example, to colleagues or anyone else you want to access your application via the Internet.
To remove access, simply remove the ngrok service form your application. The application will rebuild and only be available from your localhost.