I am new to Docker Container so wanted to help!!
I want to deploy an Web App using the Docker Image (Image: https://hub.docker.com/r/strapi/strapi)
So, I used following settings on Web App Creation
- I want to connect PostGress database which is hosted on Azure database for Postgress
Now issues,
- The above steps creates the Web App sucessfully but throws error when I navigate to web app
Error:
022-02-01T13:21:54.498Z INFO - Pulling image: strapi/strapi:3.6.8-alpine
2022-02-01T13:21:55.475Z INFO - 3.6.8-alpine Pulling from strapi/strapi
2022-02-01T13:21:55.476Z INFO - Digest: sha256:cdaa58079a087af4a623591005a8b8c86ca409b28420af148c2e4d7c5ec9da76
2022-02-01T13:21:55.477Z INFO - Status: Image is up to date for strapi/strapi:3.6.8-alpine 2022-02-01T13:21:55.481Z INFO - Pull Image successful, Time taken: 0 Minutes and 0 Seconds 2022-02-01T13:21:55.489Z INFO - Starting container for site
2022-02-01T13:21:55.491Z INFO - docker run -d -p 3582:1337 --name newapp01_0_6041931a -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITE_SITE_NAME=-e WEBSITE_AUTH_ENABLED=False -e PORT=1337 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=newapp01.azurewebsites.net -e WEBSITE_INSTANCE_ID=31e71ef1fa0c69ccdd0a4df4be1071cbacf9e8ca3620289473070b77122ac5f2 strapi/strapi:3.6.8-alpine docker run -it \ -e DATABASE_CLIENT=postgres \ -e DATABASE_NAME=strapi \ -e DATABASE_HOST=postgressk.postgres.database.azure.com \ -e DATABASE_PORT=5432 \ -e DATABASE_USERNAME=k@postgresspathik \ -e DATABASE_PASSWORD=xxx \ -p 443:1337 \ -v pwd/project-name:/srv/app \ strapi/strapi
2022-02-01T13:21:55.491Z INFO - Logging is not enabled for this container.Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2022-02-01T13:21:56.745156656Z Starting your app...
**> 2022-02-01T13:21:56.752146691Z /usr/local/bin/docker-entrypoint.sh:
exec: line 45: docker: not found**
2022-02-01T13:21:57.239Z INFO - Initiating warmup request to container newapppathik01_0_6041931a for site newapp01
2022-02-01T13:21:57.252Z ERROR - Container newapp01 for site newapp01 has exited, failing site start
**
2022-02-01T13:21:57.254Z ERROR - Container newapp01 didn't respond to HTTP pings on port: 1337, failing site start. See container logs for debugging.
**
2022-02-01T13:21:57.259Z INFO - Stopping site newapp01 because it failed during startup.
CodePudding user response:
Looks like you're trying to set some environment variables at the wrong place.
- Remove all the info from the Startup Command textbox.
- Create an Application Setting for each environment variable you need. The Application Settings will be injected as environment variables in your container.
You can set App Settings from the Azure Portal or by using the CLI:
az webapp config appsettings set --resource-group <group-name> --name <app-name> --settings DB_HOST="myownserver.mysql.database.azure.com"
