Fix: Matplotlib permission error
All checks were successful
Docker Build and Push (Multi-architecture) / build-and-push (push) Successful in 34s
All checks were successful
Docker Build and Push (Multi-architecture) / build-and-push (push) Successful in 34s
This commit is contained in:
@@ -18,7 +18,7 @@ COPY requirements.txt .
|
|||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
pip install --no-cache-dir -r requirements.txt
|
pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# Final stage - using slim instead of alpine
|
# Final stage - using slim
|
||||||
FROM python:3.11-slim
|
FROM python:3.11-slim
|
||||||
|
|
||||||
# Install minimal runtime dependencies
|
# Install minimal runtime dependencies
|
||||||
@@ -45,6 +45,11 @@ RUN mkdir -p logs embed && \
|
|||||||
chown -R bot:bot /app logs embed && \
|
chown -R bot:bot /app logs embed && \
|
||||||
chmod -R 777 /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
|
# Switch to non root user
|
||||||
USER bot
|
USER bot
|
||||||
|
|
||||||
@@ -53,6 +58,8 @@ ENV PYTHONUNBUFFERED=1
|
|||||||
ENV CONFIG_PATH=/app/config.ini
|
ENV CONFIG_PATH=/app/config.ini
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
ENV PYTHONPYCACHEPREFIX=/tmp
|
ENV PYTHONPYCACHEPREFIX=/tmp
|
||||||
|
ENV MPLCONFIGDIR=/tmp/matplotlib
|
||||||
|
ENV MPLBACKEND=Agg
|
||||||
|
|
||||||
# Run the bot using tini and entrypoint script
|
# Run the bot using tini and entrypoint script
|
||||||
ENTRYPOINT ["tini", "--", "/bin/sh", "entrypoint.sh"]
|
ENTRYPOINT ["tini", "--", "/bin/sh", "entrypoint.sh"]
|
||||||
Reference in New Issue
Block a user