From b67f7557eec913ce215898b4dc3d8a3d5f14de54 Mon Sep 17 00:00:00 2001 From: Kshitij Date: Wed, 23 Jul 2025 01:00:24 +0530 Subject: [PATCH] Simplified dockerfile for models. Removed nonroot user and no longer creating venv in built image since it's a containerized env anyway. --- models/Dockerfile | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/models/Dockerfile b/models/Dockerfile index 3462d1b..f9cad24 100644 --- a/models/Dockerfile +++ b/models/Dockerfile @@ -11,22 +11,16 @@ RUN apt update && apt upgrade -y && \ apt install -y python3 python3-pip python3.11-venv && \ apt clean all && rm -rf /var/lib/apt/lists/* -# Create non-root user -RUN useradd -s /bin/bash nonroot - # Create working directory -RUN mkdir -p /app -RUN chown -R nonroot:nonroot /app +RUN mkdir -p /app /app/public/images/ WORKDIR /app COPY . . -# Switch user -USER nonroot +# Installing npm packages +RUN npm install # Setup virtual env and install stuff -RUN python3 -m venv /app -RUN /app/bin/pip install --no-cache-dir -r requirements.txt -ENV PATH="/app/bin:$PATH" +RUN pip3 install --break-system-packages -r requirements.txt # Expose model port EXPOSE 8081