Jupyterhub can´t deploy with Configurable http Proxy and docker compose

Hello Guys,

I am facing a problem with my Deoployment of proxy using docker-compose.yml.

services:

proxy:
image: jupyterhub/configurable-http-proxy:4

command:
  - configurable-http-proxy
  - "--ip"
  - "my public ipv4"
  - "--port"
  - "80"
  - "--api-ip"
  - "10.0.1.4"
  - "--api-port"
  - "8081"
  - "--default-target"
  - "http://10.0.1.8:8001"
  - "--error-target"
  - "http://hub/hub/error"

ports:
  - "80:8081"
volumes:
  - /var/run/docker.sock:/var/run/docker.sock
  #- ./reverse-proxy/traefik.toml:/etc/traefik/traefik.toml
  - /etc/letsencrypt/live/mydomain:/etc/certs

environment:
  CONFIGPROXY_AUTH_TOKEN: "CONFIGPROXY_AUTH_TOKEN"

deploy:
  placement:
    constraints:
      - node.id == xxxx

And I hot following errors:

[+] Running 3/3
:heavy_check_mark: Network jupyter-dhbw_default Created 0.1s
:heavy_check_mark: Container jupyter-dhbw-jupyterhub-1 Created 0.5s
:heavy_check_mark: Container jupyter-dhbw-proxy-1 Created 0.5s
Attaching to jupyterhub-1, proxy-1
proxy-1 | 10:37:53.186 [ConfigProxy] info: Adding route / → http://10.0.1.8:8001
proxy-1 | 10:37:53.192 [ConfigProxy] info: Proxying http://my.public.ipv.4:80 to http://10.0.1.8:8001
proxy-1 | 10:37:53.193 [ConfigProxy] info: Proxy API at http://10.0.1.4:8081/api/routes
proxy-1 | 10:37:53.196 [ConfigProxy] error: Uncaught Exception: listen EADDRNOTAVAIL: address not available my.public.ipv.4:80
proxy-1 | 10:37:53.197 [ConfigProxy] error: Error: listen EADDRNOTAVAIL: address not available my.public.ipv.4:80
proxy-1 | at Server.setupListenHandle [as _listen2] (node:net:1855:21)
proxy-1 | at listenInCluster (node:net:1920:12)
proxy-1 | at doListen (node:net:2069:7)
proxy-1 | at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
proxy-1 | 10:37:53.197 [ConfigProxy] error: Uncaught Exception: listen EADDRNOTAVAIL: address not available 10.0.1.4:8081
proxy-1 | 10:37:53.198 [ConfigProxy] error: Error: listen EADDRNOTAVAIL: address not available 10.0.1.4:8081
proxy-1 | at Server.setupListenHandle [as _listen2] (node:net:1855:21)
proxy-1 | at listenInCluster (node:net:1920:12)
proxy-1 | at doListen (node:net:2069:7)
proxy-1 | at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
proxy-1 | 10:37:53.199 [ConfigProxy] info: Route added / → http://10.0.1.8:8001
proxy-1 exited with code 0

This means that something else is using that port. You can only have one application using port 80.

2 Likes

Thank you for your reply. If something is using it, it will say adress in used. This error means this doesnt exist? I dont know. : )

The Problem is solved.
I found that, you dont have to specify the public IP Adress.
Docker compose method just deploy it automatically on the Public Ip Adress.