Can I run Docker (e.g., Gotenberg) inside an Azure App Service that’s deployed in Code mode?

Jayanta Basumatary 20 Reputation points
2025-09-18T13:17:23.2+00:00

Hi everyone,

I’m working on an app where the API is deployed to Azure App Service using the Code publish model (Python + Gunicorn).

When I run this locally, I also spin up a Gotenberg (Docker) container from the same startup script, and the API talks to it on a different port. That setup works fine on my machine.

Now the question is:

Is it possible to do the same thing on Azure App Service when it’s deployed in Code mode?

Or is Docker only supported if I switch to the Container publish model (where I build a custom image and push it)?

If it’s not supported in Code mode, would the right approach be to run Gotenberg separately (for example in Azure Container Instances or Container Apps) and call it from the App Service?

I tried checking the docs, but couldn’t find anything that clearly says if running Docker inside a Code-based App Service is unsupported.

Any pointers or official references would be really helpful, since this will decide whether we stick with App Service (Code) or move to another setup.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Shree Hima Bindu Maganti 5,805 Reputation points Microsoft External Staff Moderator
    2025-10-03T14:12:35.1233333+00:00

    Hi @Jayanta Basumatary
    It appears you're trying to determine if you can run a Gotenberg Docker container alongside your API in Azure App Service when using Code mode. Azure App Service in Code mode does not support running Docker containers directly; Docker support is only available when you use the Container publish model, which allows you to create and deploy custom Docker images.

    Since Docker containers can't be run in your current setup, it's best to host Gotenberg separately. Azure Container Instances or Azure Container Apps are suitable options for deploying and managing containers without complex orchestration.

    Azure App Service (Code mode): Does not support Docker containers.

    Container publish model: Needed for Docker support in App Service.

    Recommended solution: Host Gotenberg in Azure Container Instances or Azure Container Apps and have your API communicate with it.

    Azure documentation on App Service and Container Apps.
    Let me know if you have any further assistances needed.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.