Should I use docker (nginx) for serving a SPA?
I’m thinking how I host this SPA? I already have one clean VM on Amazon EC2.
I was planning setup a docker (Nginx) on this EC2. However, as I said, this VM is clean. Only this SPA will use this EC2 VM.
So I’m confused by this situation. Should I use docker(nginx) or just install a Nginx on this EC2 for serving this SPA?
2 Solutions collect form web for “Should I use docker (nginx) for serving a SPA?”
AWS S3 service is capable of service static files, You just need to upload your files to a bucket, then make them public and note the public URL.
As a side note, Containerizing apps and using microservices architecture, will give you advantages, Some of them are:
- Ease of Upgrade
- Fault Containment
- Ease of technology change
- Increased Security
- Efficient Resource Utilization
S3 is cheap enough for static files, almost free compared to EC2 unless you have backend in place. You can use Cyberduck for S3 and if you want to go FTP one day, same app would give you a common UX for uploading your files.
Though Docker setup would be over engineering for static serving in IaaS, you would need to build an image that contains nginx and your files as in KyleAMathews/docker-nginx project.