Update container permissions
This commit is contained in:
@@ -13,6 +13,11 @@ 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
|
||||||
|
|
||||||
@@ -20,7 +25,8 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Create directories for persistent storage
|
# Create directories for persistent storage
|
||||||
RUN mkdir -p /data/logs
|
RUN mkdir -p /app/logs
|
||||||
|
RUN chown -R bot:bot /app
|
||||||
|
|
||||||
# Create a non-root user and switch to it
|
# Create a non-root user and switch to it
|
||||||
RUN useradd -m botuser && chown -R botuser:botuser /app
|
RUN useradd -m botuser && chown -R botuser:botuser /app
|
||||||
|
Reference in New Issue
Block a user