I am trying to run version latest tag of the image available at https://hub.docker.com/r/kernelmemory/service.
This image relies on a single file as configuration to run.
The example command to run it locally is:
docker run --volume ./appsettings.Development.json:/app/appsettings.Production.json -it --rm -p 9001:9001 kernelmemory/service:1.0
As you can see, it mounts the appsettings.Development.json file from the local host to appsettings.Production.json file on the Docker image.
Now, I want to deploy this image to Azure Container Apps. I have gone through various posts and documentation, but I couldn't find a way to mount a single file to Azure Container App, either during the deployment with Bicep or later.
Currently, I am using a FileShare as a mount.
Have you experienced this issue/limitation before? Do you have any possible workarounds or suggestions?
Mounting a single file as a volume in Azure Container Apps directly is not currently supported, as Azure Container Apps are designed to mount directories rather than individual files. However, as a workaround you can use an Azure File Share with your single file and mount it to your Azure Container App.
Create an Azure File Share
appsettings.Development.jsonfile to this file share.Mount the File Share to your Container App
When you set up your Azure Container App, you'll include the Azure File Share as a volume in the configuration. This can be done using CLI
or from portal at the time of creation or even later under container-> volume mounts
Note, you'll need to create a secret containing the access key for your storage account. This secret will be used by the Container App to authenticate with the Azure File Share.
or from portal, get the access key from storage account
and add it as a secret in your container app
References: