我正在使用以下docker compose文件部署到F1 Azure实例:
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: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.
我也将WEBSITES_PORT
设置为3000,尽管这似乎无济于事。尝试使用“ 3000:80”,但这也不起作用。
尝试访问https://wewe.azurewebsites.net
会花费一段时间,但最终失败。日志中没有任何内容。
具有讽刺意味的是,这个docker compose文件可以在我的机器上运行。
最终我通过如下配置我的应用程序使它正常工作:
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
仍不确定为何将端口映射设置为“ 80:3000”并在3000上运行该应用程序无法正常工作。
答案 0 :(得分:1)
我不确定我是否读得正确,但是看来您只能使用80或8080。