Expose a container to the internet via https://ngrok.com.
(for local testing)
Put the NGROK_AUTHTOKEN
env var into a .env
file.
NGROK_AUTHTOKEN=...
docker compose --env-file .env up
The endpoint is here: https://dashboard.ngrok.com/cloud-edge/endpoints/
Build the ngrok image.
make build
Build the sample unit
image.
make pyapp
nginx configurable server
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"
}
}
]
}
➜ ~ cat www/python1/wsgi.py
def application(environ, start_response):
start_response("200 OK", [("Content-Type", "text/plain")])
return (b"+")