angular-seed icon indicating copy to clipboard operation
angular-seed copied to clipboard

Feature: Serve prod build via Nginx Docker container

Open TheDonDope opened this issue 10 years ago • 4 comments

Hey guys,

in another project of mine i extended the docker production build to serve the files in an nginx container, see here: https://github.com/TheDonDope/crudular#dockerization

In this issue i only want to gather opinions if this enhancement might also be interesting for the seed.

Thank you @sclausen for providing the nginx.conf here https://github.com/mgechev/angular-seed/pull/1522#issuecomment-255969000

//cc @mgechev @sclausen

TheDonDope avatar Nov 05 '16 13:11 TheDonDope

Sure! Let's have this.

mgechev avatar Nov 17 '16 17:11 mgechev

Alright, i'll push an PR tomorrow :)

TheDonDope avatar Nov 17 '16 18:11 TheDonDope

I'm also using nginx to serve the static files but I'm considering dropping it in this particular case in favour of https://universal.angular.io

Have a look at the get started guide.

In my opinion, the setup should look like this:

              +---------------------------------------+
              |           Reverse proxy               |
              |      (nginx/haproxy/traefik/...)      |
              |   Handles ssl, security headers, ...  |
              +---------------------------------------+
                               |
                               |
                               |
              +------------------------------------+
              |                                    |
              |                                    |
              |                                    |
+-----(frontend container)----+            (other containers)
|             |               |
|         Universal           |
|             |               |
|       Static files          |
+-----------------------------+

Arguably, universal should not even be in the same container as the static files. But in this case, providing server-side rendering to every user of this repository might make it worth.

NicolasTr avatar Nov 19 '16 23:11 NicolasTr

Hi @NicolasTr Thank you for the input about angular/universal. Feel free to go ahead and issue a PR if you are willing :)

TheDonDope avatar Nov 20 '16 13:11 TheDonDope