Reputation: 2374
Our project requires two docker instances:
Public access to the MySQL should be forbidden. However, there should be a way to connect to the MySQL server from specific computers / specific AAD users if needed to manually alter the database or get a dump of it.
The PHP web should be available via HTTPS using a custom or Let's Encrypt certificate. Not sure, whether it should be handled inside the PHP instance, via a proxy instance, via Azure API gateway or another way.
After deploing a new PHP image, the CI should run a script inside the docker image which migrate the MySQL schema and data. The script should get a MySQL "root"-like password so it has enough permissions to do its work.
We use Azure DevOps for git repositories and for CI.
I was able to set up a Azure DevOps Pipeline YAML to build and publish the custom PHP image to an Azure Container Repository. However, I found no suitable tasks to start/configure/deploy/stop a Container Instance from Azure DevOps Releases. Neither I am sure what to use / how to add HTTPS support.
It's my first docker deployment in production - up to now, I was only using docker for development. I've tried to study the docs, search net but still has no idea what the best practices are, how to build it together. I would appreaciate any, even partial help and hints, how to correctly deploy the thing. Thanks.
Upvotes: 0
Views: 616
Reputation: 51183
I was able to set up a Azure DevOps Pipeline YAML to build and publish the custom PHP image to an Azure Container Repository. However, I found no suitable tasks to start/configure/deploy/stop a Container Instance from Azure DevOps Releases. Neither I am sure what to use / how to add HTTPS support.
Since you already succeed set CI to build the docker image and push it to Azure Container Registry (ACR).
You could then use both Azure App Service deploy and Azure Web App for Containers task to handle the deploy.
The Azure WebApp Container task similar to other built-in Azure tasks, requires an Azure service connection as an input. The Azure service connection stores the credentials to connect from Azure Pipelines or Azure DevOps Server to Azure.
Kindly take a look at below blogs show:how do people actually build their containers and then deploy them to each environment?:
Deploy an Azure Web App Container(official)
Azure DevOps: Create a Web App for Containers CI/Release pipeline for an ASP.NET Core app
Build & release a Container Image from Azure DevOps to Azure Web App for Containers
Neither I am sure what to use / how to add HTTPS support.
For this part, according to my personal understanding, it should more related to Docker image side. This should not related to Azure DevOps pipeline side.
Upvotes: 1