Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splitting the dockerfiles into multi-stage builds. #14

Open
wants to merge 1 commit into
base: tutorial
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions console logger/dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
FROM python:3.11.1-slim-buster
# Dependency-building stage.
FROM python:3.11.1-slim-buster AS build

ENV DEBIAN_FRONTEND="noninteractive"
ENV PYTHONUNBUFFERED=1
ENV PYTHONIOENCODING=UTF-8

WORKDIR /app
RUN python3 -m venv env
ENV PATH="env/bin:$PATH"

COPY requirements.txt .
RUN python3 -m pip install -r requirements.txt

# Runtime stage.
FROM python:3.11.1-slim-buster AS runtime

WORKDIR /app
COPY --from=build /app/env /app/env
ENV PATH="env/bin:$PATH"

COPY . .
RUN find | grep requirements.txt | xargs -I '{}' python3 -m pip install -r '{}' --extra-index-url https://pkgs.dev.azure.com/quix-analytics/53f7fe95-59fe-4307-b479-2473b96de6d1/_packaging/public/pypi/simple/
ENTRYPOINT ["python3", "main.py"]

ENTRYPOINT ["env/bin/python3", "main.py"]
20 changes: 17 additions & 3 deletions csv data source/dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
FROM python:3.11.1-slim-buster
# Dependency-building stage.
FROM python:3.11.1-slim-buster AS build

ENV DEBIAN_FRONTEND="noninteractive"
ENV PYTHONUNBUFFERED=1
ENV PYTHONIOENCODING=UTF-8

WORKDIR /app
RUN python3 -m venv env
ENV PATH="env/bin:$PATH"

COPY requirements.txt .
RUN python3 -m pip install -r requirements.txt

# Runtime stage.
FROM python:3.11.1-slim-buster AS runtime

WORKDIR /app
COPY --from=build /app/env /app/env
ENV PATH="env/bin:$PATH"

COPY . .
RUN find | grep requirements.txt | xargs -I '{}' python3 -m pip install -r '{}' --extra-index-url https://pkgs.dev.azure.com/quix-analytics/53f7fe95-59fe-4307-b479-2473b96de6d1/_packaging/public/pypi/simple/
ENTRYPOINT ["python3", "main.py"]

ENTRYPOINT ["env/bin/python3", "main.py"]
21 changes: 18 additions & 3 deletions name counter/dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
FROM python:3.11.1-slim-buster
# Dependency-building stage.
FROM python:3.11.1-slim-buster AS build

ENV DEBIAN_FRONTEND="noninteractive"
ENV PYTHONUNBUFFERED=1
ENV PYTHONIOENCODING=UTF-8

WORKDIR /app
RUN python3 -m venv env
ENV PATH="env/bin:$PATH"

COPY requirements.txt .
RUN python3 -m pip install -r requirements.txt


# Runtime stage.
FROM python:3.11.1-slim-buster AS runtime

WORKDIR /app
COPY --from=build /app/env /app/env
ENV PATH="env/bin:$PATH"

COPY . .
RUN find | grep requirements.txt | xargs -I '{}' python3 -m pip install -r '{}' --extra-index-url https://pkgs.dev.azure.com/quix-analytics/53f7fe95-59fe-4307-b479-2473b96de6d1/_packaging/public/pypi/simple/
ENTRYPOINT ["python3", "main.py"]

ENTRYPOINT ["env/bin/python3", "main.py"]