Skip to content

Commit

Permalink
build smaller image
Browse files Browse the repository at this point in the history
  • Loading branch information
karuboniru committed Dec 14, 2023
1 parent 07d95e2 commit 6092b79
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
FROM python:3
FROM debian:11-slim AS build
RUN apt-get update && \
apt-get install --no-install-suggests --no-install-recommends --yes python3 python3-venv && \
python3 -m venv /venv && \
/venv/bin/pip install --upgrade pip

FROM build AS build-venv
COPY requirements.txt /requirements.txt
RUN /venv/bin/pip install --disable-pip-version-check -r /requirements.txt

FROM gcr.io/distroless/python3-debian11
COPY --from=build-venv /venv /venv

WORKDIR /usr/src/app
COPY requirements.txt ./
COPY . /usr/src/app

RUN pip install --no-cache-dir -r requirements.txt
COPY . .

CMD [ "python", "./just_login.py" ]
ENTRYPOINT [ "/venv/bin/python", "/usr/src/app/just_login.py" ]

0 comments on commit 6092b79

Please sign in to comment.