I've got Jenkins and Ansible configured to trigger deployments whenever I commit to my repo. This builds my Vite app and sends the generated build folder to my EC2 instance. However, I'm not sure how to properly serve this build folder so I can access my website via a URL. Currently, I use 'npm run start' for production, but that feels off. Any suggestions on how to do this right?
2 Answers
Have you thought about using S3 with CloudFront? It's a really efficient way to host static sites, and it can simplify your setup a lot.
You could run 'npm run build' to generate your static files and then serve them using a web server like nginx. It’s pretty straightforward once you set it up!
I considered nginx, but I'm curious why other platforms like Vercel make it seem so easy. Is there a simpler option?
That sounds interesting, but I already have a CI/CD pipeline in place. I'm looking for something that integrates well with that.