From bb996f12035998a45036cc6e47984f763fa7eeb9 Mon Sep 17 00:00:00 2001 From: GREENRAT-K405 Date: Sun, 15 Feb 2026 19:16:40 +0530 Subject: [PATCH] optimize python dockerfile to be much lighter --- Dockerfile.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile.py b/Dockerfile.py index 3c3836f6..1a2a5169 100644 --- a/Dockerfile.py +++ b/Dockerfile.py @@ -1,9 +1,8 @@ -FROM jupyter/base-notebook +FROM python:3.10-slim -USER root -RUN apt-get update && apt-get install -y build-essential g++ libgl1-mesa-glx libx11-6 -COPY requirements.txt . -RUN pip install -r requirements.txt -COPY . /src WORKDIR /src +RUN apt-get update && apt-get install -y build-essential g++ libgl1-mesa-glx libx11-6 && rm -rf /var/lib/apt/lists/* +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt +COPY . .