From d1cd8faad5e2db28457ab4440a3d0b0b83cbb118 Mon Sep 17 00:00:00 2001 From: tamsinforbes <32667518+tamsinforbes@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:40:53 +0100 Subject: [PATCH] revert to what works --- python-malformed-yaml/Dockerfile | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/python-malformed-yaml/Dockerfile b/python-malformed-yaml/Dockerfile index d32f3648..c1ddd6cf 100644 --- a/python-malformed-yaml/Dockerfile +++ b/python-malformed-yaml/Dockerfile @@ -1,24 +1,14 @@ -FROM python:3.12.0-alpine3.17 +FROM python:3-slim AS builder ADD . /app WORKDIR /app +# We are installing a dependency here directly into our app source dir RUN pip install --target=/app PyYaml -RUN chown appuser:appgroup /app -ENTRYPOINT [ "/app/main.py" ] - - -# FROM python:3-slim AS builder -# ADD . /app -# WORKDIR /app - -# # We are installing a dependency here directly into our app source dir -# RUN pip install --target=/app PyYaml - -# # A distroless container image with Python and some basics like SSL certificates -# # https://github.com/GoogleContainerTools/distroless -# FROM gcr.io/distroless/python3-debian10 -# COPY --from=builder /app /app -# WORKDIR /app -# ENV PYTHONPATH /app -# CMD ["/app/main.py"] \ No newline at end of file +# A distroless container image with Python and some basics like SSL certificates +# https://github.com/GoogleContainerTools/distroless +FROM gcr.io/distroless/python3-debian10 +COPY --from=builder /app /app +WORKDIR /app +ENV PYTHONPATH /app +CMD ["/app/main.py"] \ No newline at end of file