diff --git a/dockerfile b/dockerfile index 655ee9b..6170976 100644 --- a/dockerfile +++ b/dockerfile @@ -19,13 +19,19 @@ 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 +# Create a non-root user RUN useradd -m bot -USER bot # Create directories for persistent storage and modify permissions -RUN mkdir -p /app/logs && chmod -R 777 /app/logs -RUN mkdir -p /app/embed && chmod -R 777 /app/embed +RUN mkdir -p logs && \ + chown -R bot:bot logs && \ + chmod -R 755 logs \ + mkdir -p embed && \ + chown -R bot:bot embed && \ + chmod -R 755 embed \ + +# Switch to non root user +USER bot # Set environment variables for configuration ENV PYTHONUNBUFFERED=1