anomaly / lab-web-client

A template for building accessible, localised, high performance React front ends with a standard set of libraries. Also provides a template for development servers.
Apache License 2.0
2 stars 0 forks source link

Template for serving the built files via a nginx running in a container #17

Closed devraj closed 1 year ago

devraj commented 2 years ago

While most use cases will use an objet store to serve the built static files, we should provide an example where we are serving the files from a Docker container with a web server like ngnix

Tutorial:

devraj commented 2 years ago

Found this article by tiangolo on doing exactly this https://tiangolo.medium.com/react-in-docker-with-nginx-built-with-multi-stage-docker-builds-including-testing-8cc49d6ec305

worth a read and adopt the best practices.

The article also outlines a multi stage build.