Update container permissions
This commit is contained in:
13
dockerfile
13
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
|
||||
|
Reference in New Issue
Block a user