# Code examples from: Docker for Beginners: Run Any App Without Installing It
# https://www.atulvij.com/docker-for-beginners
# Review and adapt before running; examples use sample values.

# ---- Example 1 (bash) ----
docker run --rm hello-world                     # test the install
docker run -d --name db -e POSTGRES_PASSWORD=secret -p 5432:5432 postgres:11
docker ps                                       # what is running
docker logs db                                  # its output
docker stop db && docker rm db                  # clean up

# ---- Example 2 (bash) ----
docker run -p 8888:8888 -v "%cd%":/home/jovyan/work jupyter/scipy-notebook

# ---- Example 3 (text) ----
FROM python:3.7-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY report.py .
CMD ["python", "report.py"]

# ---- Example 4 (bash) ----
docker build -t monthly-report .
docker run --rm monthly-report

