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?

  • fedora 24 run docker 32-bit image
  • Jenkins and Docker
  • Best way to to implement Spark + AWS + Caffe/CUDA?
  • Naming Docker Containers on start ECS
  • Choosing the right AWS Services and software tools
  • Docker linking container
  • Configuring Couchbase connection ports through their Node.js API [Docker]
  • x509: certificate signed by unknown authority - both with docker and with github
  • Two versions of Docker data volumes on same machine?
  • Use docker for day to day development with Rails
  • Docker Entrypoint for Postgres 9.3
  • Docker compose in production?
  • 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.