Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python dockerfile

# Dockerfile, Image, Container
# Container with python version 3.10
FROM python:3.10

# Add python file and directory
ADD main.py .

# upgrade pip and install pip packages
RUN pip install --no-cache-dir --upgrade pip && 
    pip install --no-cache-dir numpy 
    # Note: we had to merge the two "pip install" package lists here, otherwise
    # the last "pip install" command in the OP may break dependency resolution...

# run python program
CMD ["python", "main.py"]
Source by codefreelance.net #
 
PREVIOUS NEXT
Tagged: #python #dockerfile
ADD COMMENT
Topic
Name
4+9 =