From 005d7de2a37a87d6c2c4ccaa085bb95c47d677d5 Mon Sep 17 00:00:00 2001 From: "k.eaven" Date: Sun, 10 Aug 2025 08:53:24 -0700 Subject: [PATCH] Update container permissions --- dockerfile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/dockerfile b/dockerfile index 019deee..b491deb 100644 --- a/dockerfile +++ b/dockerfile @@ -13,25 +13,20 @@ RUN apt-get update && apt-get install -y \ # Copy requirements first to leverage Docker cache COPY requirements.txt . -# Create a user with given UID. -RUN useradd -m -u 5000 bot -USER bot -RUN id - # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application COPY . . +# Create a non-root user and switch to it +RUN useradd -m bot +USER bot + # Create directories for persistent storage RUN mkdir -p /app/logs RUN chown -R bot:bot /app -# Create a non-root user and switch to it -RUN useradd -m botuser && chown -R botuser:botuser /app -USER botuser - # Set environment variables for configuration ENV PYTHONUNBUFFERED=1 ENV CONFIG_PATH=/app/config.ini