Deployment and Packaging
Learn how Windsurf packages your project with Docker and deploys it to Netlify using a single AI prompt.
We'll cover the following...
After building and testing your feature, the next step is deployment. Traditionally, this involves pushing to Git, configuring a deployment service like Netlify, adjusting settings, and waiting for DNS to propagate.
With Windsurf and Cascade, you can skip that manual setup. Once your app is ready, simply type “Deploy this project to Netlify” into Cascade. It handles deployment from your IDE without requiring separate CLI commands or CI configuration. Behind the scenes, the Windsurf-Netlify integration manages everything needed to get your site live in a single step.
Once our app renders properly in the preview, it’s time to package and deploy it.
How to package the app with Windsurf
Packaging means bundling our code and environment so it runs anywhere. A popular way is to use Docker. Windsurf makes this easy: you can ask Cascade to generate a Dockerfile
for your project. Windsurf supports seamless integration with Docker and can automatically generate Dockerfiles for applications. For our Edweather app, we might type something like the following prompt in Cascade:
Prompt: “Hey Cascade, can you generate a Dockerfile for this project?”
Cascade will analyze the repo and produce a Dockerfile tailored to it. Typically, a generated Dockerfile might look like this:
FROM node:18WORKDIR /appCOPY package*.json ./RUN npm installCOPY . .RUN npm run buildCMD ["npx", "serve", "-s", "build"]
This example (for a simple frontend app) uses Node 18, installs dependencies, builds the app, and then serves the static files with npx serve
. The exact commands Cascade outputs may vary based on your app’s setup. The key point is we didn’t have to ...