From 44904d80beca6013ae25d159feb0b04f393ee137 Mon Sep 17 00:00:00 2001 From: jo Date: Wed, 11 Jan 2023 16:21:16 +0100 Subject: [PATCH] feat: don't compile python byte code in docker --- api/Dockerfile | 4 ++++ .../do-not-compile-python-byte-code-in-docker.enhancement | 1 + 2 files changed, 5 insertions(+) create mode 100644 changes/changelog.d/do-not-compile-python-byte-code-in-docker.enhancement diff --git a/api/Dockerfile b/api/Dockerfile index 47eed5fcb..89fb8607f 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -12,6 +12,8 @@ RUN poetry export --with dev --without-hashes > dev-requirements.txt FROM alpine:3.17 as builder +ENV PYTHONDONTWRITEBYTECODE=1 + RUN \ echo 'installing dependencies' && \ apk add --no-cache \ @@ -70,6 +72,8 @@ RUN \ FROM alpine:3.17 as image +ENV PYTHONDONTWRITEBYTECODE=1 + COPY --from=builder /venv /venv # emulate activation by prefixing PATH ENV PATH="/venv/bin:$PATH" diff --git a/changes/changelog.d/do-not-compile-python-byte-code-in-docker.enhancement b/changes/changelog.d/do-not-compile-python-byte-code-in-docker.enhancement new file mode 100644 index 000000000..c71fdc29f --- /dev/null +++ b/changes/changelog.d/do-not-compile-python-byte-code-in-docker.enhancement @@ -0,0 +1 @@ +Don't compile python byte code in docker