Home > Back-end >  machine learning python app in docker with anaconda for k8s
machine learning python app in docker with anaconda for k8s

Time:04-09

There is a python app for machine lerning that developer have running in docker. Azure container instance in particular. They are using micromamba:0.15.3 and inside dockerfile they also install nginx for web server. Docker file at the end will run: CMD ["./start.sh"]

and script inside:

service nginx start 
streamlit run app.py --theme.base "dark" --server.address localhost --server.port 5000  --server.enableCORS=false

Also I saw that they use anaconda locally to run web app. This also runs streamlit

Now I would get rid of nginx part in dockerfile since will be moving to k8s and will be using nginx ingress controller ingres as vhost which will be pointin to the running python service

Which is the Docker image that I should use for this? what the difference between using conda, miniconda or python official image? Don´t I just need python image where you can add streamlit, like here?

https://hub.docker.com/r/mambaorg/micromamba

https://hub.docker.com/_/python

CodePudding user response:

You are right, you can create a simple Dockerized App derived from an official Python Image, Create a virtual environment and install a requirements.txt file in the build stage into the environment for streamlit and other dependencies. Anaconda and Miniconda just wrap the management of python virtual environments. If there is an environment.yml instead of requirements.txt you can use conda create -f environment.yml to create the environment in your Docker Container.

  • Related