Jack Hadrill 9031220efa
Some checks failed
continuous-integration/drone/push Build is failing
First working version.
2022-08-27 18:31:48 +00:00

34 lines
738 B
Python

"""Launch Container Spawner."""
import typer
from waitress import serve
from containerspawner import app
def cli(
host: str = typer.Option(
"0.0.0.0",
envvar=["CONTAINER_SPAWNER_HOST"],
help="Host for Container Spawner to listen on."
),
port: str = typer.Option(
"8080",
envvar=["CONTAINER_SPAWNER_PORT"],
help="Port for Container Spawner to listen on."
)
):
"""Run Container Spawner application using Waitress."""
try:
serve(app, host=host, port=port)
except OSError as exception:
print(str(exception))
raise typer.Exit(code=1)
def main() -> None:
"""Run CLI parser."""
typer.run(cli)
if __name__ == "__main__":
main()