Update container permissions

This commit is contained in:
2025-08-10 08:53:24 -07:00
parent c553c6877e
commit 005d7de2a3

View File

@@ -13,25 +13,20 @@ RUN apt-get update && apt-get install -y \
# Copy requirements first to leverage Docker cache # Copy requirements first to leverage Docker cache
COPY requirements.txt . COPY requirements.txt .
# Create a user with given UID.
RUN useradd -m -u 5000 bot
USER bot
RUN id
# Install Python dependencies # Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application # Copy the rest of the application
COPY . . COPY . .
# Create a non-root user and switch to it
RUN useradd -m bot
USER bot
# Create directories for persistent storage # Create directories for persistent storage
RUN mkdir -p /app/logs RUN mkdir -p /app/logs
RUN chown -R bot:bot /app 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 # Set environment variables for configuration
ENV PYTHONUNBUFFERED=1 ENV PYTHONUNBUFFERED=1
ENV CONFIG_PATH=/app/config.ini ENV CONFIG_PATH=/app/config.ini