Skip to content

Latest commit

 

History

History
106 lines (77 loc) · 3.35 KB

File metadata and controls

106 lines (77 loc) · 3.35 KB

Deploy a Dockerized Tomcat

appservice/docker-tomcat/README.md

Prerequisites

This example assumes you have previously completed the following examples:

  1. Create an Azure Resource Group
  2. Create an Azure Container Registry
  3. Push a Tomcat Docker image to Azure Container Registry
  4. Create settings.xml using admin access keys
  5. Create an Azure App Service Plan

Deploy Tomcat using a Docker image

To deploy Tomcat use the following command lines:

  export APPSERVICE_DOCKER_TOMCAT=appservice-docker-tomcat-$RANDOM

  mvn azure-webapp:deploy \
    --settings=$SETTINGS_XML \
    -DappName=$APPSERVICE_DOCKER_TOMCAT \
    -DimageName=$ACR_TOMCAT_IMAGE \
    -DappServicePlan=$APPSERVICE_PLAN \
    -DresourceGroup=$RESOURCE_GROUP \
    -DserverId=$ACR_NAME

  az webapp show \
    --resource-group $RESOURCE_GROUP \
    --name $APPSERVICE_DOCKER_TOMCAT \
    --query 'hostNames[0]' \
    --output tsv

Then open your browser to the URL shown as output and you should see:

And this is served by a custom Tomcat using a Docker image coming from our 
own Azure Container Registry.

Properties supported by the example

The example supports the following properties that you can pass in as -Dname=value to the Maven command line to customize your deployment.

name description
appName the application name
appServicePlan the App Service plan to use
imageName the Docker image name
serverId the Maven server id
registry the Azure Container Registry name
registryUrl the Azure Container Registry url
resourceGroup the Azure Resource Group name

Cleanup

Do NOT forget to remove the resources once you are done running the example.

3m