Further updates to fix permissions issues
This commit is contained in:
@@ -11,6 +11,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||||||
|
|
||||||
COPY bot.py .
|
COPY bot.py .
|
||||||
COPY config.py .
|
COPY config.py .
|
||||||
|
COPY entrypoint.sh .
|
||||||
|
|
||||||
# Create DB directory with proper permissions
|
# Create DB directory with proper permissions
|
||||||
RUN mkdir -p /app/DB && chown -R botuser:botgroup /app
|
RUN mkdir -p /app/DB && chown -R botuser:botgroup /app
|
||||||
@@ -20,4 +21,5 @@ ENV PYTHONUNBUFFERED=1
|
|||||||
# Switch to non-root user
|
# Switch to non-root user
|
||||||
USER botuser
|
USER botuser
|
||||||
|
|
||||||
|
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||||
CMD ["python", "bot.py"]
|
CMD ["python", "bot.py"]
|
||||||
|
|||||||
@@ -12,3 +12,4 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./DB:/app/DB
|
- ./DB:/app/DB
|
||||||
|
entrypoint: ["/app/entrypoint.sh", "python", "bot.py"]
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Fix permissions for DB folder
|
||||||
|
chown -R botuser:botgroup /app/DB
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
Reference in New Issue
Block a user