Setting up and using a basic webservice

I’m trying to set up a web service running inside binder or with repo2docker locally. I start with the most basic use case, running python3 -m http.server 8888. I don’t see any documentation to run that service when creating the docker container with repo2docker. I’ve tried using the --appendix 'CMD ["python3", "-m", "http.server", "8888"] flag but maybe not correctly.

I also want to access the web service, once running, via some URL like http://localhost:12345/proxy/8888 but that only gives a 404 page, even when I run the service manually inside the container.

I have a sample repo here and would welcome any kind of hints. Thanks!

This extension should do exactly what you want:

1 Like

Ok, thanks! If I add jupyter-server-proxy to the environment the proxying works for my simple directory service I start it manually inside the container. But I still don’t see the necessary info on the pages on RTD that would let me run the service when building the container. The --appendix doesn’t do it. And the Theia example is overkill to start with (and not complete, I believe).

Meanwhile I’ve found this advice which helps me start the service and list it in the Jupyter “New…” dropdown menu… Moving on now…

If you want the service to start when the container starts checkout the start file