Skip to content

Commit

Permalink
Removes distroless image
Browse files Browse the repository at this point in the history
to offset the volatile nature of prototyping conflicting with the restricted binaries in distroless
  • Loading branch information
duck-nukem committed Nov 2, 2021
1 parent 829ac42 commit ef8c9ef
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,15 @@ FROM python:3.10-slim-buster AS build
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN apt update && apt install -y \
libpython3.7 \
libpq-dev \
gcc
RUN pip install --upgrade pip

WORKDIR /opt/app
COPY . /opt/app
RUN pip install -r /opt/app/requirements.txt

FROM gcr.io/distroless/python3
ENV PYTHONPATH=/usr/local/lib/python3.10/site-packages

# Enable this to allow PyCharm to generate skeletons properly
COPY --from=build /bin/ /bin/

# application and its dependencies
COPY --from=build $PYTHONPATH $PYTHONPATH
COPY --from=build /opt/app/ /opt/app/

WORKDIR /opt/app

# Overwriting the default python entrypoint for better integration with tools (like IDEs)
ENTRYPOINT []

0 comments on commit ef8c9ef

Please sign in to comment.