Skip to content

A14 - Docker

Latest

Choose a tag to compare

@deemasaddik deemasaddik released this 07 Dec 04:30
ef9e125

Let's create a dockerfile that will allow us to run python

Step 1. Build the Dockerfile

Start with a base image

FROM python:3.8-slim

Set working directory

WORKDIR /app

Copy app files to the container

COPY . /app

Install dependencies

RUN pip install -r requirements.txt

Run the app

CMD ["python", "app.py"]

  1. Build the image
    docker build -t my-python-app .

  2. Run the image
    docker run my-python-app

This assignment will be due Dec 6 before finals. I will add the submission requirement to the assignment at a later date.