我在2024年12月在Azure App Services中运行的Docker撰写了多包装应用程序。
现在,2025年1月,我删除了该应用程序,并计划像以前一样重新创建它。,但是,我现在发现缺少Azure App Services中选择
'Dockercompose(预览)'的选项。 它去哪里了?预览结束了吗?它是在其他地方移动的,还是被完全删除了? 现在,一个人如何运行多容器的码头组成?
它去哪里了?预览结束了吗?它是在其他地方移动的,还是被完全删除了?
当您想部署多容器应用程序时,您可以考虑以下一些选项:
您可以使用
Azure Container Apps
,它支持多范围的应用程序,并允许使用Docker组合文件部署,可以将其转换为兼容性。 请参阅此
多c,以了解Azure容器应用程序。Multi-container.yaml:
properties:
managedEnvironmentId: "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.App/managedEnvironments/{environment-name}"
configuration:
ingress:
external: true
targetPort: 80
dapr: # Optional: If using Dapr for service-to-service communication
enabled: true
appId: my-multi-container-app
template:
containers:
- name: web-app
image: myregistry.azurecr.io/web-app:latest
resources:
cpu: 0.5
memory: 1Gi
env:
- name: APP_ENV
value: production
- name: api-service
image: myregistry.azurecr.io/api-service:latest
resources:
cpu: 0.5
memory: 1Gi
env:
- name: API_KEY
value: my-secret-api-key
- name: redis
image: redis:latest
resources:
cpu: 0.25
memory: 512Mi
现在,您可以通过运行以下命令来通过Azure CLI部署应用程序
az containerapp create --name my-multi-container-app --resource-group my-resource-group --yaml multi-container.yaml
Azure Kubernetes Service (AKS)
允许运行一个主容器与其他壁板容器一起以用于多容器功能。 请参阅此
DOC,以更好地了解应用程序服务边车容器。