Should I use docker (nginx) for serving a SPA?

I only have 1 javascript file(bundle.js packed by webpack) and 1 html. It’s kinda like 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?

  • Building and running a docker image for a Go executable
  • Connect Rails/Unicorn/Nginx container to MySQL container
  • Provide environment variables to elastic beanstalk docker deployment
  • Can't connect to Amazon RDS from Docker container
  • bluemix container KO with ip public but OK in local
  • How to disable sticky sessions in Openshift3
  • external_hosts docker composer not working
  • DC/OS and concurrent deployments
  • How to connect to a docker box running elasticsearch inside a vagrant guest os?
  • Move all Docker stuff?
  • Running on Tensorflow Installed with Docker
  • Docker permissions host user volume in the container
  • 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.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.