|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: Docker Image Hosting Guide for Blazor Web App | Syncfusion |
| 4 | +description: Learn here all about creating Docker image from Blazor Smart PDF Viewer Web App and ensure the images locally by hosting it as a link. |
| 5 | +platform: document-processing |
| 6 | +control: SfSmartPdfViewer |
| 7 | +documentation: ug |
| 8 | +--- |
| 9 | + |
| 10 | +# Docker Image Hosting Guide for Blazor Web App |
| 11 | + |
| 12 | +We aim to assist developers in reducing deployment time and simplifying the publishing process using Docker images. The [Syncfusion Document Processing API](https://hub.docker.com/r/syncfusion/document-processing-apis) is available as a ready-to-use Docker image for document processing APIs that ensures a seamless experience for Docker users. The following sections will guide you on how to publish docker images. |
| 13 | + |
| 14 | +## Deployment requirement |
| 15 | +### Hardware requirement |
| 16 | +The following hardware requirements are necessary to run document processing API |
| 17 | + |
| 18 | +Windows |
| 19 | +CPU: 2-core |
| 20 | +Memory: 8GB RAM |
| 21 | +Disk space: 8GB or more |
| 22 | + |
| 23 | +### Software requirements |
| 24 | +The following software requirements are necessary to run document processing API |
| 25 | + |
| 26 | +Application: Rancher Desktop. |
| 27 | +Web Browser: Microsoft Edge, Mozilla Firefox, and Chrome. |
| 28 | + |
| 29 | +## Steps to configure and run docker container |
| 30 | +### Step1: |
| 31 | +Install the Rancher desktop application [Rancher Desktop](https://github.com/rancher-sandbox/rancher-desktop/releases) |
| 32 | + |
| 33 | +### Step2: |
| 34 | +Open the rancher desktop application Select the displayed option. |
| 35 | + |
| 36 | + |
| 37 | +### Step3: |
| 38 | +Create a Smart Pdf Viewer web app sample using the following [documentation](https://help.syncfusion.com/document-processing/pdf/smart-pdf-viewer/blazor/getting-started/web-app). |
| 39 | + |
| 40 | +### Step4: |
| 41 | +Right-click Smart PDF Viewer web app sample to add the docker support with Linux. |
| 42 | +. |
| 43 | + |
| 44 | +### Step5: |
| 45 | +Once the docker file is added open the docker file and add the following line |
| 46 | + |
| 47 | +{% tabs %} |
| 48 | +{% highlight c# tabtitle="Dockerfile" hl_lines="2 4 6" %} |
| 49 | +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base |
| 50 | +RUN ln -s /lib/x86_64-linux-gnu/libdl-2.24.so /lib/x86_64-linux-gnu/libdl.so |
| 51 | + |
| 52 | +RUN apt-get update && apt-get install -y --allow-unauthenticated libgdiplus libc6-dev libx11-dev |
| 53 | + |
| 54 | +RUN ln -s libgdiplus.so gdiplus.dll |
| 55 | + |
| 56 | + |
| 57 | +USER root |
| 58 | + |
| 59 | + |
| 60 | +WORKDIR /app |
| 61 | + |
| 62 | + |
| 63 | +EXPOSE 8080 |
| 64 | +EXPOSE 8081 |
| 65 | +.... |
| 66 | +{% endhighlight %} |
| 67 | +{% endtabs %} |
| 68 | + |
| 69 | +. |
| 70 | +N> Remove the `User` if not needed or change the User type to `root` for providing elevated privileges. |
| 71 | + |
| 72 | +### Step6: |
| 73 | +Publish the image by building the DockerFile |
| 74 | +. |
| 75 | + |
| 76 | +### Step7: |
| 77 | +Open the comment prompt or power shell and enter the following command to list the published docker images. |
| 78 | + |
| 79 | +{% tabs %} |
| 80 | +{% highlight c# tabtitle="Docker Image" %} |
| 81 | + |
| 82 | +docker image ls |
| 83 | + |
| 84 | +{% endhighlight %} |
| 85 | +{% endtabs %} |
| 86 | + |
| 87 | +### Step8: |
| 88 | +To check the published images locally, run the below command which is in the format docker run -d -p 6001:{exposed Port} {Image ID}. |
| 89 | + |
| 90 | +{% tabs %} |
| 91 | +{% highlight c# tabtitle="Docker Run" %} |
| 92 | + |
| 93 | +docker run -d -p 6001:8080 4eead1aaf7a5 |
| 94 | + |
| 95 | +{% endhighlight %} |
| 96 | +{% endtabs %} |
| 97 | + |
| 98 | +### Step9: |
| 99 | +Ensure the published image is as per requirement in the hosted link `http://localhost:6001/` |
| 100 | + |
| 101 | +## See also |
| 102 | + |
| 103 | +* [Steps to deploy Docker Images from Container Registry to Azure App Services](https://learn.microsoft.com/en-us/azure/app-service/quickstart-custom-container?tabs=dotnet&pivots=container-linux-azure-portal). |
| 104 | + |
0 commit comments