/dockerngrok

Expose a container to the internet via <https://ngrok.com>

Primary LanguageDockerfile

dockerngrok

Expose a container to the internet via https://ngrok.com.

(for local testing)

env

Put the NGROK_AUTHTOKEN env var into a .env file.

NGROK_AUTHTOKEN=...

run

docker compose --env-file .env up

The endpoint is here: https://dashboard.ngrok.com/cloud-edge/endpoints/

build

Build the ngrok image.

make build

Build the sample unit image.

make pyapp

unit

nginx configurable server

https://unit.nginx.org/

Configuration for the unit-python:-

{
  "listeners": {
    "*:8081": {
      "pass": "applications/python_app"
    }
  },
  "applications": {
    "python_app": {
      "type": "python",
      "path": "/www/python_app",
      "module": "wsgi"
    }
  }
}

/www/python_app is a path on the host.

Configuration for a static site:-

{
  "listeners": {
    "0.0.0.0:8081": {
      "pass": "routes"
    }
  },

  "routes": [
    {
      "action": {
        "share": "/www/html$uri"
      }
    }
  ]
}

python app

~ cat www/python1/wsgi.py
def application(environ, start_response):
        start_response("200 OK", [("Content-Type", "text/plain")])
        return (b"+")