How to install java 8 in python webapp

Shruti Bangar 0 Reputation points
2023-10-25T07:23:15.01+00:00

Hi,

I'm using tabula library in python code which needs java8 for the support. So, need to install java8 in azure webapp.

Webapp Details:

Runtime Stack: Python - 3.9

Operating System: Linux

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andriy Bilous 11,821 Reputation points MVP Volunteer Moderator
    2023-10-27T13:19:23.11+00:00

    Hello @Shruti Bangar

    App Service Linux is running your application inside Microsoft Docker container.
    Azure App Service uses Oryx for building and running applications.

    As you have tabula library in python code which needs java8, which is not present in the Azure built-in image.
    You need to create the runtime yourself for your special purpose, it means you need to create the custom image.
    Example of installation java8 to custom Docker image:

    FROM tiangolo/uwsgi-nginx-flask:python3.6
    
    RUN mkdir /code
    WORKDIR /code
    ADD requirements.txt /code/
    RUN pip install -r requirements.txt --no-cache-dir
    ADD . /code/
    
    RUN apt-get update && \
        DEBIAN_FRONTEND=noninteractive \
    
    #CMD ["python", "/code/manage.py", "runserver", "0.0.0.0:8000"]
    ENTRYPOINT ["init.sh"]
    

    Another option to provide custom build scripts, which can sometimes be used to set up specific settings or binaries.
    https://learn.microsoft.com/en-us/answers/questions/991247/need-to-have-java-while-running-python-webapp-on-l

    0 comments No comments

Your answer

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