6 ms·
Ask HN: How do you deploy your side project?
I'm trying to figure out how to deploy my side project (solo dev) but I'm no devops pro. My stack is node + postgres. I'd love to have a nice CI/CD pipeline so I'm curious what others have found successful at this scale.
It seems as though caprover and dokku are in this kind of space. I've also considered k8s/k3s but it seems overbearing. I'm experimenting with docker swarm mode, which seems more manageable. Just looking for recommendations.
- jacobrussell 5y agoFor web applications Frontend: Angular Backend: Python CI/CD: GitHub Actions Cloud: AWS DB: Postgres or DynamoDB
- jcuenod 5y agoHow are you deploying your stack? I'm more wondering about deployment than stack (I realize they're related questions, though). Is Python serving your frontend or are you using docker? Are your github actions building and pushing images or are they pushing git commits into a repo mirrored on an EC2 instance? Are you using EC2 or does AWS have some arcane way to deploy python and angular projects?
- marcelnita 5y agoIf we're talking AWS, then I'd go for AWS Fargate. You can push your Docker image, built via GH actions, to their registry (ECR). From there on you spin up a task definition based on the image and then a new ECS service. In front of it you can have an ALB for load balancing, but that's optional, although recommended.
- rudasn 5y agoSince this is a side project, it depends on what you want to learn at the end of the day. You could invest in learning the tools that bigger teams are using, like kubernetes, or cloud-specific offerings, like AWS Fargate or whatever, but my guess is that if you don't already use those tools for your day job you may end up spending more time on "how to deploy" as opposed to actually having something to deploy. A simpler approach would be to focus on sharpening your existing skills, or perhaps using one or two additional tools that get the job done without too much fanfare. For example, if you already use git you could learn how to setup your own git server with hooks, so that you can just `git push production v0.0.2` to your own server to deploy your application. Personally I find docker a very nice tool for both development and production as it allows me to quickly try out new things without messing up with my dev or prod machines. There's a lot of things to learn (if you aren't familiar with it yet), and it's best to start from the basics (networks, volumes, container lifecycle) and later move on to more complicated stuff, if and when, needed (swarm). Just keep in mind what your end goal is: if your side project is more about learning how to deploy real-world apps at scale then yes, kubernetes and cloud-specific technologies may be the best approach. If you just want to get your code out there and used by other people you can easily get away with `git pull && npm start`.
- jcuenod 5y agoThis is helpful, thanks. Software is only a hobby for me so you're right, I want to be deploying more than figuring out how to deploy. I'm a curious person, though, so if it's worth learning k8s, I'll do it. At the same time, k8s doesn't seem like the right tool for this job and sometimes the devops people on HN feel a bit like craftsmen with only one tool that makes every problem look like a nail. v. 1 of my project uses `git push googlecloud` for deployments and I have git hooks that rebuild on push. I have been using docker more and more, though, which is making me interested in swarm as a deploy target (I've also thought of just using docker-compose to push).
- debaserab2 5y agoI just launched my most recent side project on Cloudflare pages. It's a pretty great UX. Just plug in your git repo, add your build steps, and it basically takes care of the rest: reversible production deployments - a long with unique endpoints for development branches. My project is purely static which makes it considerably easier to deploy, but I'm looking forward to trying out Cloudflare Workers the next time I have more steep requirements. Personally I'm pretty steeped in the devops world at my day job so dealing with that as little as possible is pretty appealing to me for hobby projects. Might be a no-go for you if Postgres is a big part of your project.
- jcuenod 5y agoI must say, I've really liked github pages for static projects. But yes, for this postgres is essential.
- Jemaclus 5y agoI have this problem as well, and I'm commenting here in part to follow the thread. I have a Go project, so all I really need to do is deploy a binary. My go-to in the past is just to SCP onto my server, but since the other binary is already running, there's some blue/green swap thing that has to happen, and I struggle with this. My side projects don't make any money, so I want this to be as free as possible, and so I've so-far resisted complex CI/CD pipelines, but it feels like I'll need to put more money into this if I want the CI/CD thing instead of SSHing in to disable the server, SCPing the new binary, and then SSHing back in to restart the service. If anyone has any recommendations for CI/CD deployments of Go binaries onto an AWS EC2 server, I'd love to hear more.
- jcuenod 5y agoYes, I'm definitely also looking for the cheapest way of making this happen. So the idea of using some container registry is not appealing to me.
- tedmiston 5y agoGitHub Actions workflows go a long way and you get a generous amount of free build minutes per month. Here's their Node setup action and a minimal workflow. https://github.com/actions/setup-node https://github.com/actions/setup-node You can use something like AWS ECS Fargate to run your app containers as scalable tasks easily if you're already Dockerized. And there are alternatives like Elastic Beanstalk if you're not. You might also consider more PaaS type solutions like Heroku. If you don't need a stateful server, something like Vercel Serverless Functions provides a pretty nice dev experience. https://vercel.com/docs/concepts/functions/serverless-functions https://vercel.com/docs/concepts/functions/serverless-functi...