From e47a28efae63e29c137483bc0c108d5c349a7745 Mon Sep 17 00:00:00 2001 From: Slfhstd Date: Wed, 11 Mar 2026 18:09:41 +0000 Subject: [PATCH] Further updates to fix permissions issues --- Dockerfile | 2 ++ docker-compose.yml | 1 + entrypoint.sh | 7 +++++++ 3 files changed, 10 insertions(+) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 6da75dd..7527e45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ RUN pip install --no-cache-dir -r requirements.txt COPY bot.py . COPY config.py . +COPY entrypoint.sh . # Create DB directory with proper permissions RUN mkdir -p /app/DB && chown -R botuser:botgroup /app @@ -20,4 +21,5 @@ ENV PYTHONUNBUFFERED=1 # Switch to non-root user USER botuser +ENTRYPOINT ["/app/entrypoint.sh"] CMD ["python", "bot.py"] diff --git a/docker-compose.yml b/docker-compose.yml index a7f0a50..809f8cb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,3 +12,4 @@ services: restart: unless-stopped volumes: - ./DB:/app/DB + entrypoint: ["/app/entrypoint.sh", "python", "bot.py"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..bc986c7 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +# Fix permissions for DB folder +chown -R botuser:botgroup /app/DB + +exec "$@" \ No newline at end of file