From 461d4c01d9e15f2b8b62a7793edb967a84ee3a96 Mon Sep 17 00:00:00 2001 From: Esteban Maya Cadavid Date: Mon, 11 Mar 2024 12:50:01 -0500 Subject: [PATCH 1/2] :construction_worker: Avoid creating unnecessary *.pyc files with PYTHONDONTWRITEBYTECODE=1 --- docker-images/python3.7-alpine3.8.dockerfile | 2 ++ docker-images/python3.7.dockerfile | 2 ++ docker-images/python3.8-alpine3.11.dockerfile | 2 ++ docker-images/python3.8.dockerfile | 2 ++ docker-images/python3.9-alpine3.13.dockerfile | 2 ++ docker-images/python3.9.dockerfile | 2 ++ 6 files changed, 12 insertions(+) diff --git a/docker-images/python3.7-alpine3.8.dockerfile b/docker-images/python3.7-alpine3.8.dockerfile index 127de0a..ae3384d 100644 --- a/docker-images/python3.7-alpine3.8.dockerfile +++ b/docker-images/python3.7-alpine3.8.dockerfile @@ -1,5 +1,7 @@ FROM python:3.7-alpine3.8 +ENV PYTHONDONTWRITEBYTECODE=1 + LABEL maintainer="Sebastian Ramirez " COPY requirements.txt /tmp/requirements.txt diff --git a/docker-images/python3.7.dockerfile b/docker-images/python3.7.dockerfile index 26a19be..86eb6d5 100644 --- a/docker-images/python3.7.dockerfile +++ b/docker-images/python3.7.dockerfile @@ -1,5 +1,7 @@ FROM python:3.7 +ENV PYTHONDONTWRITEBYTECODE=1 + LABEL maintainer="Sebastian Ramirez " COPY requirements.txt /tmp/requirements.txt diff --git a/docker-images/python3.8-alpine3.11.dockerfile b/docker-images/python3.8-alpine3.11.dockerfile index 5bd40a2..e05b007 100644 --- a/docker-images/python3.8-alpine3.11.dockerfile +++ b/docker-images/python3.8-alpine3.11.dockerfile @@ -1,5 +1,7 @@ FROM python:3.8-alpine3.11 +ENV PYTHONDONTWRITEBYTECODE=1 + LABEL maintainer="Sebastian Ramirez " COPY requirements.txt /tmp/requirements.txt diff --git a/docker-images/python3.8.dockerfile b/docker-images/python3.8.dockerfile index bf27d9d..b7ff64a 100644 --- a/docker-images/python3.8.dockerfile +++ b/docker-images/python3.8.dockerfile @@ -1,5 +1,7 @@ FROM python:3.8 +ENV PYTHONDONTWRITEBYTECODE=1 + LABEL maintainer="Sebastian Ramirez " COPY requirements.txt /tmp/requirements.txt diff --git a/docker-images/python3.9-alpine3.13.dockerfile b/docker-images/python3.9-alpine3.13.dockerfile index d33a603..dc47630 100644 --- a/docker-images/python3.9-alpine3.13.dockerfile +++ b/docker-images/python3.9-alpine3.13.dockerfile @@ -1,5 +1,7 @@ FROM python:3.9-alpine3.13 +ENV PYTHONDONTWRITEBYTECODE=1 + LABEL maintainer="Sebastian Ramirez " COPY requirements.txt /tmp/requirements.txt diff --git a/docker-images/python3.9.dockerfile b/docker-images/python3.9.dockerfile index 1d365f6..f9b1a55 100644 --- a/docker-images/python3.9.dockerfile +++ b/docker-images/python3.9.dockerfile @@ -1,5 +1,7 @@ FROM python:3.9 +ENV PYTHONDONTWRITEBYTECODE=1 + LABEL maintainer="Sebastian Ramirez " COPY requirements.txt /tmp/requirements.txt From 176d4d71786e308638e07ab518feaf1c1bb6e7e6 Mon Sep 17 00:00:00 2001 From: Esteban Maya Cadavid Date: Wed, 20 Mar 2024 13:25:57 -0500 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=A7=20Added=20PYTHONUNBUFFERED=3D1?= =?UTF-8?q?=20as=20env=20in=20docker=20images=20to=20unbuffer=20logs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-images/python3.7.dockerfile | 1 + docker-images/python3.8.dockerfile | 1 + docker-images/python3.9.dockerfile | 1 + 3 files changed, 3 insertions(+) diff --git a/docker-images/python3.7.dockerfile b/docker-images/python3.7.dockerfile index 86eb6d5..8cf0cbb 100644 --- a/docker-images/python3.7.dockerfile +++ b/docker-images/python3.7.dockerfile @@ -1,6 +1,7 @@ FROM python:3.7 ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 LABEL maintainer="Sebastian Ramirez " diff --git a/docker-images/python3.8.dockerfile b/docker-images/python3.8.dockerfile index b7ff64a..ae29e7c 100644 --- a/docker-images/python3.8.dockerfile +++ b/docker-images/python3.8.dockerfile @@ -1,6 +1,7 @@ FROM python:3.8 ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 LABEL maintainer="Sebastian Ramirez " diff --git a/docker-images/python3.9.dockerfile b/docker-images/python3.9.dockerfile index f9b1a55..563b3d7 100644 --- a/docker-images/python3.9.dockerfile +++ b/docker-images/python3.9.dockerfile @@ -1,6 +1,7 @@ FROM python:3.9 ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 LABEL maintainer="Sebastian Ramirez "