Python cluster application deploy

Asked

Viewed 46 times

0

I need to deploy a python application in a cluster kubernetes. This application is using the venv and I don’t know if it’s right to generate a container image with the venv directory. What is the recommended way to create an image from a python application using venv

1 answer

1


I use Docker, but it may be helpful. So I just use virtualenv in development. When I deploy to my dockerfile I say which image I use in the python case 3.6 then I also run Pip install -r requiments.txt, so my image will contain the files I need. Something about like this:

FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get upgrade -y && pip3 install pipenv

ADD ./src /app

WORKDIR /app

EXPOSE 8000

RUN pip install -r requirements.txt

Browser other questions tagged

You are not signed in. Login or sign up in order to post.