Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ARG UID=1000
ARG GID=1000

COPY requirements.txt /tmp/requirements.txt
COPY ./entrypoint.sh /usr/bin/entrypoint.sh
RUN set -xe && \
echo $(echo BUILD_TIME_ALPINE_VERSION: && /bin/cat /etc/alpine-release) && \
apk upgrade --no-cache && \
Expand All @@ -16,12 +15,13 @@ RUN set -xe && \
pip install -r /tmp/requirements.txt && \
addgroup -g ${GID} -S ${GROUP} && \
adduser -u ${UID} -S -D ${USER} ${GROUP} && \
chmod a+x /usr/bin/entrypoint.sh && \
mkdir /app && chown ${USER} /app


COPY --chown=${USER} k8sci/ /app/k8sci/
WORKDIR /app
USER ${USER}
ENV PYTHONUNBUFFERED=TRUE

ENTRYPOINT /usr/bin/entrypoint.sh
ENTRYPOINT echo $(echo ALPINE_VERSION: && /bin/cat /etc/alpine-release) && \
gunicorn --bind 0.0.0.0:5000 --enable-stdio-inheritance --error-logfile "-" k8sci.wsgi:app
14 changes: 14 additions & 0 deletions Dockerfile_distroless
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.7-slim AS build
COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt

### INFO:
# What is distroless: https://medium.com/better-programming/how-to-harden-your-containers-with-distroless-docker-images-c2abd7c71fdb
# Google Base Images: https://github.com/GoogleContainerTools/distroless/
FROM gcr.io/distroless/python3-debian10
COPY k8sci/ /app/k8sci/
COPY --from=build /usr/local/bin/gunicorn /app/gunicorn
COPY --from=build /usr/local/lib/python3.7/site-packages /usr/local/lib/python3.7/site-packages
WORKDIR /app
ENV PYTHONPATH=/usr/local/lib/python3.7/site-packages PYTHONUNBUFFERED=TRUE
CMD ["gunicorn","--bind","0.0.0.0:5000","--enable-stdio-inheritance","--error-logfile","-","k8sci.wsgi:app"]
9 changes: 0 additions & 9 deletions entrypoint.sh

This file was deleted.