DEV Community

Shahariyar Dipto
Shahariyar Dipto

Posted on

I was struggling to deploy my web apps on base-tier servers(AWS t2 micro with 1gb ram) servers, which made me build Graft

Context: to streamline app and ci/cd i had to completely leverage on tool like Dokploy, maybe i was too invested in it. But due to low budget, and no revenue, i had to shift my web apps in a weaker server t2micro, the problem is that Dokploy itself takes more than 1gb ram sometimes, which resulted in my server crashing before i could even deploy my app. I researched and mostly learned that how much bloat it puts on a server.

The solution: I could not find much other than manually SSHing to the server, its too much work, so i had to come up with my personal deployment tool. That's how Graft started.

The concept is simple, instead of an agent running on server, the agent is runs locally, it SSH's into my server, sets up basically everything, from gateway reverse proxy through Traefik, and basically push my source to server and build and deploy. That was the initial Graft.

Current version (v2.2.3) includes:

  • CI/CD with graft-hook (Rust webhook receiver)
    • 1.7MB idle footprint
    • 15MB RAM during active deployment
    • Compare to Dokploy's 1GB+
  • Automated backups & rollbacks (simple commands)
  • DNS automation (Cloudflare integration)
  • Docker Compose passthrough (run any docker compose command remotely) Graft can do backups and rollbacks with just simple commands, can migrate DNS records (if using Cloudflare) with just one command!

The result? It takes roughly 15 minutes to ship a web app through graft provided your docker compose is already working locally. And the cherry on top, its capable of running docker compose commands(any) to my server from my local terminal!

The Workflow

# One-time setup
graft init

# Deploy
graft sync

# Manage like localhost
graft logs backend
graft restart frontend
graft ps
Enter fullscreen mode Exit fullscreen mode

Past few days, put my sweat off to make a better documentation and launching on package managers so others can use it too.

Now graft can be installed with homebrew, Winget, apt, dnf, yay, paru or through a sh script.

The documentation: https://graftdocs.vercel.app

If you are interested I would recommend trying it on a test server environment so you can test it out without worrying about anything.

I added all the features i could think of for my use cases.

If you have a useful feature that can be implemented i am open to ideas. Also if you want, you can contribute and make a better product for the community

Check out on GitHub: https://github.com/skssmd/Graft

Top comments (0)