Usage in Docker and Azure App Service
This page covers how to run List & Label Cross Platform within a Docker container and deploy your containerized application to Azure App Service.
Running in Docker
List & Label Cross Platform runs seamlessly inside Docker. When using a downstripped Linux image, you may need to install additional packages to ensure all dependencies are met. Below is an example Dockerfile snippet that installs the necessary libraries:
# This stage is used when running from Visual Studio in fast mode (Default for Debug configuration)
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
USER $APP_UID
WORKDIR /app
USER root
RUN apt-get update && apt-get install -y libc6 libfontconfig1 libfreetype6 libpng16-16 libjpeg62-turbo libgif7 && apt-get clean
USER $APP_UID
Depending on your target OS, you also need to install additional NuGet packages for Skia, e. g. SkiaSharp.NativeAssets.Linux on Linux.
Tip
Make sure to embed all fonts in your project file when deploying to Docker. By default, the image won't have any fonts installed, so embedding them ensures everything looks as expected.
Notes:
- The base image
mcr.microsoft.com/dotnet/aspnet:9.0is a stripped-down Linux image. - The
apt-get installcommand installs essential libraries required for rendering and processing fonts and images. - Adjust package names or versions as necessary based on your Linux distribution or specific application needs.
Deploying to Azure App Service
Azure App Service supports running Docker containers, making it straightforward to deploy applications that use List & Label Cross Platform.
Steps to deploy
Build your Docker image:
Build your Docker image locally or in your CI/CD pipeline using your Dockerfile. For example:docker build -t mylistlabelapp .Push the image to a container registry:
Push the image to a container registry like Azure Container Registry (ACR) or Docker Hub:docker tag mylistlabelapp myregistry.azurecr.io/mylistlabelapp:latest docker push myregistry.azurecr.io/mylistlabelapp:latestCreate an Azure App Service instance:
In the Azure Portal, create a new App Service configured for Docker. Choose the "Container" option, and provide the image source details (e.g., registry URL, image name, and tag).Configure deployment settings:
- Container settings:
Configure startup commands if necessary, and ensure that environment variables or settings required are properly set. - Continuous deployment (optional):
Set up continuous deployment from your container registry for automated updates.
- Container settings:
Connect your app to the container:
Once deployed, Azure App Service will run your container. You can monitor logs, manage scaling, and configure networking (such as custom domains or SSL certificates) directly from the Azure Portal.
By following these steps, you can successfully containerize your application with List & Label Cross Platform and deploy it on Azure App Service. This approach ensures a consistent environment from development to production with minimal configuration changes.
For further details on Docker deployment and Azure App Service configuration, refer to the official Docker documentation and Azure App Service documentation.