Is the default image for Azure Webapps public?

1.1k views Asked by At

I would like to run a PHP App in Azure Webapps. For this I would like to use my own Container, because I have some problems with the current default.

Is the Code, or the Dockerfile somewhere public, so one can use it as a base?

EDIT: I would also like to file a potential bug, but I also cannot find an issue tracker.

2

There are 2 answers

0
AjayKumar On BEST ANSWER

As Jason correctly pointed out, adding some more info on this topic for additional clarity:

In Azure App service, you can have different flavor/version of WebApp, as follows:

1.Code + Windows – You select the Application stack and deploy your code.

2.Code + Linux (WebApp Linux) - App Service on Linux provides pre-defined application stacks on Linux with support for languages such as .NET, PHP, Node.js and others. These are blessed images, predefined by platform. Here you just deploy your code.

  1. Docker Container + Linux (WebApp for Container) – custom image (code already part of the image, and not deployed separately) - container image become containers at runtime.

  2. Docker Container + Windows (WebApp for Windows Container) – custom image – container image become containers at runtime.

Yes, you can also use a custom Docker image to run your webapp on an application stack that is not already defined in Azure. Azure App Service provides pre-defined application stacks on Windows like ASP.NET or Node.js, running on IIS.

az webapp config container set You can run az webapp list-runtimes --linux to view the latest languages and supported versions. If the runtime your application requires is not supported in the built-in images, you can deploy it with a custom container.

Kind checkout these documentation for more details.

https://learn.microsoft.com/azure/app-service/quickstart-custom-container?pivots=container-windows https://learn.microsoft.com/azure/app-service/quickstart-custom-container?pivots=container-linux

All App Service base images can be found here:

https://github.com/Azure-App-Service/php (in your case)

-Similarly you can find for other languages-

https://github.com/Azure-App-Service/python

https://github.com/Azure-App-Service/ruby

https://github.com/Azure-App-Service

If there is any change on the WebApp blessed images you could typically see that change in this repository: https://github.com/Azure/app-service-quickstart-docker-images

And yes, it is a good place to track your feedback/suggestions for the repo: https://github.com/Azure/app-service-quickstart-docker-images/issues

0
stena On

While the answer from @AjayKumar-MSFT matches the question perfectly, I upvoted and accepted, but want to share some of the information I found out in addition.

I started to build my own containers based on the work by webdevops. I find it a very good base image, since it has important stuff like syslog and supervisor preconfigured and is easily extendible. It can be found in the php docker repo or on dockerhub. I used (and linked) the apache variant, but I am considering to switch to nginx. The documentation was precise but relativeliy thin for newcomers like me, but it works really good.

The have webssh one needs to enable ssh on port 2222 having static credentials root:Docker!. I added this block to a derived Dockerfile to start ssh using supervisord:

 # Enable ssh
ENV SSH_PASSWD "root:Docker!"
RUN apt-get update \
        && apt-get install -y --no-install-recommends dialog \
        && apt-get update \
    && apt-get install -y --no-install-recommends openssh-server \
    && echo "$SSH_PASSWD" | chpasswd
COPY docker/sshd_config /etc/ssh/
COPY docker/ssh.conf /opt/docker/etc/supervisor.d/
RUN mkdir -p /var/run/sshd

docker/sshd_config:


Port            2222
ListenAddress       0.0.0.0
LoginGraceTime      180
X11Forwarding       yes
Ciphers aes128-cbc,3des-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr
MACs                    hmac-sha1,hmac-sha1-96
StrictModes         yes
SyslogFacility      DAEMON
PasswordAuthentication  yes
PermitEmptyPasswords    no
PermitRootLogin     yes

docker/ssh.conf:

[program:sshd]
command=/usr/sbin/sshd -D

Next, I put my code to /app .

When the starting point is somewhere else, as it is with some frameworks, you can override an env var like for example:

ENV WEB_DOCUMENT_ROOT=/app/public