Windsurf integration

Dockerfile Missing System Dependencies in Windsurf Project

Your Windsurf-generated Dockerfile builds fail or the container crashes at runtime because system-level dependencies are missing. Node.js native modules like sharp, canvas, bcrypt, or puppeteer require system packages (libvips, libc, chromium) that aren't installed in the Docker image.

Cascade generates a Dockerfile that works for pure JavaScript apps but doesn't account for native dependencies. The build may fail during npm install when compiling native modules, or worse, it may build successfully but crash at runtime when the native module is first loaded.

This is especially common when deploying to production for the first time after developing locally, where system dependencies were already present on the development machine.

Error Messages You Might See

Error: Cannot find module 'sharp' Error: libvips.so.42: cannot open shared object file Error: Failed to launch the browser process (Puppeteer) gyp ERR! build error - native module compilation failed Error: /lib/x86_64-linux-gnu/libm.so.6: version 'GLIBC_2.29' not found
Error: Cannot find module 'sharp'Error: libvips.so.42: cannot open shared object fileError: Failed to launch the browser process (Puppeteer)gyp ERR! build error - native module compilation failedError: /lib/x86_64-linux-gnu/libm.so.6: version 'GLIBC_2.29' not found

Common Causes

  • Sharp requires libvips — The sharp image processing library needs libvips and its dependencies installed at the OS level
  • Puppeteer needs Chromium — Puppeteer requires a Chromium installation with many system libraries (libx11, libgbm, libnss3, etc.)
  • Canvas requires build tools — The node-canvas package needs build-essential, libcairo2-dev, libpango1.0-dev, and libjpeg-dev
  • bcrypt requires compilation tools — Native bcrypt (not bcryptjs) needs python3 and build-essential to compile during npm install
  • Alpine image too minimal — Cascade used node:alpine which is missing many libraries. Some packages need the full node:slim or node:bookworm image
  • Multi-stage build drops dependencies — A multi-stage Dockerfile installs deps in the build stage but doesn't copy the system libraries to the runtime stage

How to Fix It

  1. Identify which native modules you use — Check package.json for sharp, canvas, bcrypt, puppeteer, better-sqlite3, or other packages that compile native code
  2. Add apt-get install for each dependency — Add a RUN apt-get update && apt-get install -y [packages] layer before npm install. Each native module documents its required system packages
  3. Use node:slim instead of node:alpine — Alpine uses musl libc which causes issues with many native modules. node:slim (Debian-based) has better compatibility
  4. Copy system libraries in multi-stage builds — If using multi-stage, COPY --from=builder /usr/lib/ and other library paths needed by native modules
  5. Use pre-built binaries where possible — Sharp and bcrypt offer pre-built binaries for common platforms. Ensure your Dockerfile platform matches and npm can download them
  6. Test the Docker build locally — Run docker build and docker run locally before deploying. Test the specific features that use native modules

Real developers can help you.

PawelPloszaj PawelPloszaj I'm fronted developer with 10+ years of experience with big projects. I have small backend background too David Olverson David Olverson Solo dev shipping production apps with AI-assisted development. I specialize in rescuing broken Lovable/Bolt/Cursor builds and taking them to production. 10+ apps shipped including SaaS CRMs, gaming platforms, real estate tools, and Discord bots. Stack: Next.js 16, TypeScript, Tailwind CSS, FastAPI, PostgreSQL, Prisma. I use Claude Code with 50+ custom skills for rapid delivery. Average turnaround: 2-4 weeks from broken prototype to production. Jaime Orts-Caroff Jaime Orts-Caroff I'm a Senior Android developer, open to work in various fields Caio Rodrigues Caio Rodrigues I'm a full-stack developer focused on building practical and scalable web applications. My main experience is with **React, TypeScript, and modern frontend architectures**, where I prioritize clean code, component reusability, and maintainable project structures. I have strong experience working with **dynamic forms, state management (Redux / React Hook Form), and complex data-driven interfaces**. I enjoy solving real-world problems by turning ideas into reliable software that companies can actually use in their daily operations. Beyond coding, I care about **software quality and architecture**, following best practices for componentization, code organization, and performance optimization. I'm also comfortable working across the stack when needed, integrating APIs, handling business logic, and helping transform prototypes into production-ready systems. My goal is always to deliver solutions that are **simple, efficient, and genuinely useful for the people using them.** prajwalfullstack prajwalfullstack Hi Im a full stack developer, a vibe coded MVP to Market ready product, I'm here to help Vlad Temian Vlad Temian 15+ years shipping production infrastructure for startups. Former CTO at qed.builders (acquired by The Sandbox). Cursor ambassador and agentic tooling builder. I've scaled systems, automated deployments, and built observability tools for AI coding workflows. I specialize in taking vibe-coded apps from broken prototype to production-ready: fixing Supabase auth/RLS, Stripe integrations, deployment pipelines, and cleaning up AI-generated spaghetti. I build tools in this space (agentprobe, claudebin, micode) and understand both sides: how AI generates code and why it breaks. https://blog.vtemian.com/ Milan Surelia Milan Surelia Milan Surelia is a Mobile App Developer with 5+ years of experience crafting scalable, cross-platform apps at 7Span and Meticha. At 7Span, he engineers feature-rich Flutter apps with smooth performance and modern UI. As the Co-Founder of Meticha, he builds open-source tools and developer-focused products that solve real-world problems. Expertise: 💡 Developing cross-platform apps using Flutter, Dart, and Jetpack Compose for Android, iOS, and Web. 🖋️ Sharing insights through technical writing, blogging, and open-source contributions. 🤝 Collaborating closely with designers, PMs, and developers to build seamless mobile experiences. Notable Achievements: 🎯 Revamped the Vepaar app into Vepaar Store & CRM with a 2x performance boost and smoother UX. 🚀 Launched Compose101 — a Jetpack Compose starter kit to speed up Android development. 🌟 Open source contributions on Github & StackOverflow for Flutter & Dart 🎖️ Worked on improving app performance and user experience with smart solutions. Milan is always happy to connect, work on new ideas, and explore the latest in technology. rayush33 rayush33 JavaScript (React.js, React Native, Node.js) Developer with demonstrated industry experience of 4+ years, actively looking for opportunities to hone my skills as well as help small-scale business owners with solutions to technical problems Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system. Prakash Prajapati Prakash Prajapati I’m a Senior Python Developer specializing in building secure, scalable, and highly available systems. I work primarily with Python, Django, FastAPI, Docker, PostgreSQL, and modern AI tooling such as PydanticAI, focusing on clean architecture, strong design principles, and reliable DevOps practices. I enjoy solving complex engineering problems and designing systems that are maintainable, resilient, and built to scale.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

Should I use node:alpine or node:slim for my Dockerfile?

Use node:slim (Debian-based) unless you specifically need Alpine's small size and have verified all your dependencies work on Alpine. Alpine uses musl libc instead of glibc, which breaks many native Node.js modules like sharp, canvas, and bcrypt.

Why does my app work locally but crash in Docker?

Your local machine has system libraries pre-installed (from Homebrew, apt, etc.) that your Docker image doesn't have. Docker starts with a minimal OS, so every system dependency must be explicitly installed in the Dockerfile.

Related Windsurf Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help