Running a docker container in a serverless environment with private networking
We are building an aspnet core web app. It has two main projects. One is for booting up the web APIs and another is for db migration. Db migration project is a console application. We want to run db migration first through something similar to AWS lambda, and on successful exit, We will run our web application through Azure App Service. Now, the challenge within azure is that Azure Functions are not truly serverless if you select Function Premium and all required features such as Linux environment with Private Link is only available in premium plans. Is there a truly serverless way of executing our console application?
This is the docker-compose I use to execute the same scenario in a VM. Works in a VM but wants to use Azure App Service.
services:
app:
image: ${IMAGE_NAME}
container_name: app
environment:
RUNNING_ENVIRONMENT: Development
depends_on:
migrator:
condition: service_completed_successfully
redis:
condition: service_started
ports:
- 5001:80
volumes:
- ./appsettings.Production.json:/app/appsettings.Production.json
migrator:
image: ${MIGRATOR_IMAGE_NAME}
container_name: migrator
environment:
RUNNING_ENVIRONMENT: Development
volumes:
- ./appsettings.Production.json:/app/appsettings.Production.json
redis:
image: redis:latest