I'm having a Dotnet core base image in Dockerfile. I need to call some python scripts using python interpreter from .Net Core Project internally. Now, there can be multiple options to add python interpreter like creating a seperate python container or install the python in the current .net core image like below code in DockerFile :
RUN apt-get install -y python3-pip python3-dev \
&& cd /usr/local/bin \
&& ln -s /usr/bin/python3 python \
&& pip3 install --upgrade pip
But, running the above commands increases the image size by 400 MB.
I have pulled the alpine python image and run it in a different container and it consumes only 45 MB. So, what's the best possible way to configure python in .Net core? And is it a better approach to create a separate python container and also how can I call a python script using a python interpreter that is installed in a separate container?
P.S: I am very new to Docker