0

Can I use a custom Docker image for my Python webapp in Azure, and then deploy my python application to that container through a pipeline? We need a specific tool to run the Python app so we can not use the default Azure container as it does not meet the requirements for that tool.

I do not want to add my Python web app to the image itself.

I created an image and depoyed that one but the logs in Azure say

'Container XXX didn't respond to HTTP pings on port: 80, failing site start. See container logs for debugging.'

I then added a "EXPOSE 80" section to my Dockerfile but then I get no logs at all.

4
  • 1
    If your application isn't in the image, how does it get deployed? Why not include it in the image? Commented Feb 27, 2024 at 12:38
  • 1
    Can you please share your Dockerfile and what tool you want to use to run the python app? Commented Feb 28, 2024 at 8:11
  • @DavidMaze I do it through a pipeline in Azure for the other Web apps we have. Commented Feb 29, 2024 at 5:43
  • @VivekVaibhavShandilya We want to use PyAudio, this is the docker file Commented Feb 29, 2024 at 18:24

1 Answer 1

0

To Check logs of Azure webapps running on container you need to enable App Service Logs and then you can see logs in Logs Stream.

  • Open deployed Web App
  • Select App Service Logs in Monitoring section on the left side panel
  • Enable to File System and Click on save
  • Open Log Stream (below App Service Logs)
  • it will take some time to connect and after that you will be able to see you app logs

I have created a simple Flask app

app.py:

from flask import Flask

app = Flask(__name__)

@app.route('/')

def hello():
    message = "Greetings! Wecome to Flask App"
    return message

app.run(host='0.0.0.0', port=5000)

Dockerfile:

FROM python:3.11-alpine3.19

WORKDIR /app

COPY . .

RUN pip install -r requirements.txt

EXPOSE 5000:5000

ENTRYPOINT [ "python","app.py" ]

OUTPUT:

Sign up to request clarification or add additional context in comments.

2 Comments

This is exactly what I didn't want to do. I know how to create an image with the python app in it.
I tried to deploy using github pipeline into the docker conatiner after setting up the image dockerfile. deployment is successful 1. But I don't think it is possible as file are not being copied to container which is resulting in error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.