kongeor
kongeor

Reputation: 732

Cannot access a docker compose deployed instance on Azure

I'm deploying to a F1 Azure instance using the following docker compose file:

version: '3.3'

services:
  cache:
    image: redislabs/redisearch
    restart: always
  web:
    restart: always
    image: kongeor/wewe
    ports:
      - "3000:3000"
    environment:
      - OPENWEATHER_API_KEY=<key>
      - REDIS_URL=redis://cache:6379
    depends_on:
      - cache

Nothing suspicious in the logs:

2019-12-07 13:39:03.594 INFO  - Starting multi-container app, configuration = 
version: '3.3'

services:
  cache:
    image: redislabs/redisearch
    restart: always
  web:
    restart: always
    image: kongeor/wewe
    ports:
      - "3000:3000"
    environment:
      - OPENWEATHER_API_KEY=<key>
      - REDIS_URL=redis://cache:6379
    depends_on:
      - cache
2019-12-07 13:39:05.165 INFO  - Pulling image from Docker hub: redislabs/redisearch
2019-12-07 13:39:06.130 INFO  - latest Pulling from redislabs/redisearch
2019-12-07 13:39:06.131 INFO  -  Digest: sha256:86ff65a78dd68ad28d3a0d12012e631b79db6f793a4423bbfcd531d9de5306f5
2019-12-07 13:39:06.133 INFO  -  Status: Image is up to date for redislabs/redisearch:latest
2019-12-07 13:39:06.137 INFO  - Pull Image successful, Time taken: 0 Minutes and 0 Seconds
2019-12-07 13:39:06.199 INFO  - Starting container for site
2019-12-07 13:39:06.200 INFO  - docker run -d -p 3426:6379 --name wewe_cache_0_0f710006 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITES_PORT=3000 -e WEBSITE_SITE_NAME=wewe -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=wewe.azurewebsites.net -e WEBSITE_INSTANCE_ID=1c78c400fa4008b653d1a97806c414fdf5b270a99e81ecee57e6f9db2b830412 redislabs/redisearch  

2019-12-07 13:39:06.201 INFO  - Logging is not enabled for this container.
Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2019-12-07 13:39:06.329 INFO  - Pulling image from Docker hub: kongeor/wewe
2019-12-07 13:39:07.241 INFO  - latest Pulling from kongeor/wewe
2019-12-07 13:39:07.241 INFO  -  Digest: sha256:13bda75ec2953569322a22d9121c90cd9e90c1baf723c168cdc8d97878acbaa8
2019-12-07 13:39:07.242 INFO  -  Status: Image is up to date for kongeor/wewe:latest
2019-12-07 13:39:07.245 INFO  - Pull Image successful, Time taken: 0 Minutes and 0 Seconds
2019-12-07 13:39:07.286 INFO  - Starting container for site
2019-12-07 13:39:07.288 INFO  - docker run -d -p 0:3000 --name wewe_web_0_0f710006 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITES_PORT=3000 -e WEBSITE_SITE_NAME=wewe -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=wewe.azurewebsites.net -e WEBSITE_INSTANCE_ID=1c78c400fa4008b653d1a97806c414fdf5b270a99e81ecee57e6f9db2b830412 kongeor/wewe  

2019-12-07 13:39:07.289 INFO  - Logging is not enabled for this container.
Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.

I have also set WEBSITES_PORT to 3000 although this doesn't seem to help. Have tried with "3000:80" but this didn't work either.

Trying to access https://wewe.azurewebsites.net takes a while and fails in the end. There is nothing in the logs.

Ironically, this docker compose file works on my machine.

Update

Eventually I got it working by configuring my app as follows:

version: '3.3'

services:
  cache:
    image: redislabs/redisearch
    restart: always
  web:
    restart: always
    image: kongeor/wewe
    ports:
      - "80:80"
    environment:
      - OPENWEATHER_API_KEY=<key>
      - REDIS_URL=redis://cache:6379
      - PORT=80
    depends_on:
      - cache

Still not sure why having a port mapping of "80:3000" and running the app on 3000 wouldn't work.

Upvotes: 0

Views: 261

Answers (1)

4c74356b41
4c74356b41

Reputation: 72171

I'm not sure I read this right, but it seems you can only use 80 or 8080.

https://learn.microsoft.com/en-us/azure/app-service/containers/configure-custom-container#unsupported-options

Upvotes: 1

Related Questions