From 55971496c842c6cfe4489cbc487d4d0cc82f9bfd Mon Sep 17 00:00:00 2001 From: Eaven Kimura Date: Mon, 29 Sep 2025 05:07:24 +0000 Subject: [PATCH] Fix: Matplotlib permission error --- dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dockerfile b/dockerfile index bf4b633..e4c72a9 100644 --- a/dockerfile +++ b/dockerfile @@ -18,7 +18,7 @@ COPY requirements.txt . RUN --mount=type=cache,target=/root/.cache/pip \ pip install --no-cache-dir -r requirements.txt -# Final stage - using slim instead of alpine +# Final stage - using slim FROM python:3.11-slim # Install minimal runtime dependencies @@ -45,6 +45,11 @@ RUN mkdir -p logs embed && \ chown -R bot:bot /app logs embed && \ chmod -R 777 /app logs embed +# Create and set permissions for matplotlib config directory +RUN mkdir -p /tmp/matplotlib && \ + chown -R bot:bot /tmp/matplotlib && \ + chmod -R 777 /tmp/matplotlib + # Switch to non root user USER bot @@ -53,6 +58,8 @@ ENV PYTHONUNBUFFERED=1 ENV CONFIG_PATH=/app/config.ini ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONPYCACHEPREFIX=/tmp +ENV MPLCONFIGDIR=/tmp/matplotlib +ENV MPLBACKEND=Agg # Run the bot using tini and entrypoint script ENTRYPOINT ["tini", "--", "/bin/sh", "entrypoint.sh"] \ No newline at end of file