I am currently trying to set up a multi-container docker application built and deployed using Azure Pipelines to an Azure App Service running Linux.
In this application I have my frontend, backend and postgres database, where I need persistent data for the database.
After trying a lot of different configurations, I've ended up with something like this (obv omitted irrelevant info):
docker-compose.yml
services:
postgres:
image: postgres:alpine
ports:
- 5432:5432
volumes:
- ${WEBAPP_STORAGE_HOME}:/var/lib/postgresql/data/pgdata
server:
depends_on:
- postgres
client:
depends_on:
- server
azure-pipelines.yml
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: DockerCompose@0
displayName: Build services
inputs:
containerregistrytype: 'Azure Container Registry'
dockerComposeFile: '**/docker-compose.yml'
action: 'Build Services'
- task: DockerCompose@0
displayName: Push container to container registry
inputs:
containerregistrytype: 'Azure Container Registry'
dockerComposeFile: '**/docker-compose.yml'
action: 'Push Services'
- task: DockerCompose@0
displayName: Run services
inputs:
containerregistrytype: 'Azure Container Registry'
dockerComposeFile: '**/docker-compose.yml'
action: 'Run Services'
During the "Run services" task the build fails with the following error:
[error]The WEBAPP_STORAGE_HOME variable is not set. Defaulting to a blank string.
The Run services task was originally added because without it I ended up with only the frontend part of the application running on the App Service.
I've added WEBSITES_ENABLE_APP_SERVICE_STORAGE = TRUE to my App Service configuration, but that didn't do anything. I suspect this is because the Run Services task is initiated before its pushed to the App Service.
Is there something obvious I am missing here? I've been stuck on this for a while now and I'm not sure what to do next.