- = Example Dockerfile to use as base =
- Multistage, state one "FROM base as builder" builds code/libs
- Second stage starts over "FROM base" and copies "--from=builder" files from first container.
example Dockerfile
FROM python:3.7-alpine as base FROM base as builder RUN mkdir /install WORKDIR /install COPY requirements.txt /requirements.txt RUN pip install --install-option="--prefix=/install" -r /requirements.txt FROM base COPY --from=builder /install /usr/local COPY src /app COPY README.md / WORKDIR /app #With entrypoint can pass commandline arguments ENTRYPOINT ["python" , "send-mail.py"]