Flask development

FROM ubuntu:20.04
RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y python3

RUN apt-get install -y python3-pip

COPY requirements.txt /opt/
RUN pip3 install -r /opt/requirements.txt

CMD FLASK_APP=app FLASK_DEBUG=1 flask run --host --port 5000

$ docker build -t mydocker .
$ docker run -it --name dev --rm -p:5001:5000 -v $(pwd):/opt/  mydocker

Access via http://localhost:5001/

The -it is needed so we can see the log on the command line and we can easily stop the development container.