I have spring boot java application . For some of its api, it calls a python program(which is present in src folder e.g. abc.py) to get the output.
I have a dockerfile to dockerize the application. I am able to successfully build the image and container is runnning out of the image . But when I call the api , it throws error and says python command not found . Also when I go inside docker container , when I check for 'which python' , it does not show anything.
For python install and making python environment variable set inside this docker , what should be mentioned in the dockerfile.
FROM gradle:4.10.1-jdk8-alpine AS build
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle build --no-daemon
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir -p /dispython
WORKDIR /dispython
COPY requirements.txt /dispython
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
RUN python --version
RUN which python
#ENV PYTHONPATH "${PYTHONPATH}:/dispython"
FROM openjdk:8-jre-slim
EXPOSE 8081
RUN mkdir /app
COPY --from=build /home/gradle/src/build/libs/*.jar /app/spring-boot
application.jar
ENTRYPOINT ["java", "-XX:+UnlockExperimentalVMOptions", "-
XX:+UseCGroupMemoryLimitForHeap", "-
Djava.security.egd=file:/dev/./urandom","-jar","/app/spring-
boot-application.jar"]
Advance thanks