I'm unable to SSH from the link (Kudu WebSSH) in the Azure Portal | App Service navigation pane, to a multi-container service deployed through App Service | Deployment Center | Docker Compose (Preview).
For me, everything works fine if I have specify a single container (Django) through Azure | App Service | Deployment Center. The container starts with port 2222 exposed and the SSH to the IP address works fine.
However, when using Docker Compose (Preview) with multiple containers (Gunicorn & Nginx), the SSH appears to fail because of the wrong IP address. SSH attempts to connect to an IP address that is not assigned to either Gunicorn or Nginx. It appears to be an IP address (Host) for the network that both Gunicorn and Nginx are part of, but not specific to either.
From Kudu Web SSH error message at bottom of browser:
SSH CONNECTION CLOSE - Error: connect ECONNREFUSED 172.16.117.4:2222Error: connect ECONNREFUSED 172.16.117.4:2222
From webssh log:
Host: 172.16.117.4
webssh2 Login: user=root from=127.0.0.1 host=172.16.117.4 port=2222 sessionID=undefined allowreplay=undefined
Headers: {<hidden>}
Host from file: 172.16.117.4
DEBUG: Local ident: 'SSH-2.0-ssh2js0.1.16'
on.error - Error: connect ECONNREFUSED 172.16.117.4:2222Error: connect ECONNREFUSED 172.16.117.4:2222Error: connect ECONNREFUSED 172.16.117.4:2222
From Docker Nginx log showing IP address 172.16.123.1
2021-05-11T15:16:38.065233343Z 172.16.123.1 - - [11/May/2021:15:16:38 +0000] "GET / HTTP/1.1" 301 5 "-" "AlwaysOn" "127.0.0.1:16497"
From Docker Gunicorn log showing IP address 172.16.117.3
2021-05-11T14:26:19.518533085Z [2021-05-11 14:26:19 +0000] [18] [INFO] Using worker: sync
2021-05-11T14:26:19.524015163Z [2021-05-11 14:26:19 +0000] [20] [INFO] Booting worker with pid: 20
2021-05-11T14:26:20.040158579Z Executing /home/site/wwwroot/<hidden>/settings.py ...
2021-05-11T14:26:20.040183880Z Hostname : <hidden>
2021-05-11T14:26:20.040189381Z IP : 172.16.117.3
2021-05-11T14:26:20.040193481Z platform.system() == Linux
How does Azure | App Service | SSH know which IP address on a multi-container service is the correct IP address with port 2222 exposed?
Or, how do we configure the containers to forward SSH requests from App Service Host at 172.16.117.4:2222 to Gunicorn container listening at 172.16.117.3:2222?
Do I need to add a customer network to the Docker-Compose file shown below?
version: '3.4'
services:
gunicorn:
image: <hidden>
volumes:
- static_volume:/home/site/wwwroot/<hidden>/static/
expose:
- 8000
- 2222
nginx:
image: <hidden>
volumes:
- static_volume:/home/site/wwwroot/<hidden>/static/
ports:
- <hidden>:80
depends_on:
- gunicorn
volumes:
static_volume:
Jerome