Untitled

Dockerfile

FROM ubuntu:20.04 #<1>
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update #<2>
RUN apt-get install -y unzip graphviz curl musescore3 python3-pip

RUN pip install --upgrade pip #<3>

WORKDIR /app #<4>

COPY ./requirements.txt /app #<5>
RUN pip install -r /app/requirements.txt

# Hack to get around tensorflow-io issue - <https://github.com/tensorflow/io/issues/1755>
RUN pip install tensorflow-io
RUN pip uninstall -y tensorflow-io

COPY /notebooks/. /app/notebooks #<6>
COPY /scripts/. /app/scripts

ENV PYTHONPATH="${PYTHONPATH}:/app" #<7>
  1. The first line defines the base image. Our base image is an Ubuntu 20.04 (Linux) operating system. This is pulled from DockerHub - the online store of publicly available images (https://hub.docker.com/_/ubuntu).
  2. Update apt-get, the Linux package manager and install relevant packages
  3. Upgrade pip the Python package manager
  4. Change the working directory to /app.
  5. Copy the requirements.txt file into the image and use pip to install all relevant Python packages
  6. Copy relevant folders into the image
  7. Update the PYTHONPATH so that we can import functions that we write from our /app directory