feat: add canvas runtime dependencies to frontend Docker image for Trianglify support

This commit is contained in:
Muhammad Ibrahim
2025-10-28 18:31:55 +00:00
parent 3ce8c02a31
commit e9368d1a95
3 changed files with 7 additions and 10 deletions

View File

@@ -39,6 +39,9 @@ RUN npm run build
# Production stage # Production stage
FROM nginxinc/nginx-unprivileged:alpine FROM nginxinc/nginx-unprivileged:alpine
# Install runtime dependencies for canvas
RUN apk add --no-cache cairo pango jpeg libpng giflib
ENV BACKEND_HOST=backend \ ENV BACKEND_HOST=backend \
BACKEND_PORT=3001 BACKEND_PORT=3001

View File

@@ -265,11 +265,8 @@ const Layout = ({ children }) => {
pattern.toCanvas(bgCanvasRef.current); pattern.toCanvas(bgCanvasRef.current);
} }
} catch (error) { } catch (error) {
// Canvas/trianglify not available, skip background generation silently // Canvas/trianglify not available, skip background generation
// Only log in development for debugging console.warn("Could not generate Trianglify background:", error);
if (import.meta.env.DEV) {
console.warn("Could not generate Trianglify background:", error);
}
} }
}; };

View File

@@ -81,11 +81,8 @@ const Login = () => {
pattern.toCanvas(canvasRef.current); pattern.toCanvas(canvasRef.current);
} }
} catch (error) { } catch (error) {
// Canvas/trianglify not available, skip background generation silently // Canvas/trianglify not available, skip background generation
// Only log in development for debugging console.warn("Could not generate Trianglify background:", error);
if (import.meta.env.DEV) {
console.warn("Could not generate Trianglify background:", error);
}
} }
}; };