Fix: Matplotlib permission error
All checks were successful
Docker Build and Push (Multi-architecture) / build-and-push (push) Successful in 34s

This commit is contained in:
2025-09-29 05:07:24 +00:00
parent 135d596119
commit 55971496c8

View File

@@ -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"]