You are planning a container deployment for an Azure AI service. Explain how you would prepare the container, including the selection of the base image, configuration of environment variables, and ensuring compatibility with Azure Kubernetes Service (AKS).