When you delete an Azure App Service instance, it will delete the resources associated with it, but it will not delete any persistent data associated with the app. In the case of your Docker Compose configuration, the volumes section specifies that a volume named pg-data should be used to store data for the postgres container. This volume is not deleted when you delete the App Service instance, so the data stored in it will persist across deployments.
To ensure that the volume is deleted when you delete the App Service instance, you will need to remove the volume manually. You can do this by running the following command:
docker volume rm pg-data
You can also delete the volume via Azure portal or Azure CLI.
Alternatively, you can use a named volume instead of a host-mounted volume in your compose file to ensure that volume is deleted along with the deletion of the app service.
volumes:
pg-data:
name: pg-data
This will create a named volume, which is managed by Docker and will be deleted when the app service is deleted.