简体   繁体   中英

Azure App Service startuop command isn't working on a docker container

I'm using the Azure AppService version of WordPress. This version uses the wordpress-alpine-php docker image, running nginx version 1.20.2.

I need to run a startup script. I've followed all the documentation but it's not working.

I added the script as a startup command on the general settings tab of the configuration blade.

UPDATE: There is no error in the docker logs. 在此处输入图像描述 在此处输入图像描述

In the log stream, I see it applies this startup command to the docker command (at the end).

2023-01-28T15:47:13.502Z INFO - docker run -d --expose=80 --name doublekblog_53_90b5e145 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=true -e WEBSITE_SITE_NAME=doublekblog -e WEBSITE_AUTH_ENABLED=False -e PORT=80 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=doublekblog.azurewebsites.net -e WEBSITE_INSTANCE_ID=a6aeecea0459d3f037d6e8e066c862b9ee22384acef65d19b8cae7b67921b742 -e HTTP_LOGGING_ENABLED=1 -e WEBSITE_USE_DIAGNOSTIC_SERVER=False mcr.microsoft.com/appsvc/wordpress-alpine-php:stage3 /home/site/repository/movedefaultconf.sh

This script never runs.

The script works when I run it manually. As a test, I changed the script to create a file and that didn't work. I even updated the startup command in azure to only touch a file and that didn't seem to be applied.

Please check that the environment variables are correctly set, that the image version exists and the ports are reachable and open. Also, you should check the logs of the container and Azure App Service for more information. This is for your reference: https://geeksnewslab.com/the-azure-app-service-startup-command-issue-while-using-the-docker-container/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM