Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serving static assets #1

Open
Globegitter opened this issue Oct 1, 2014 · 2 comments
Open

Serving static assets #1

Globegitter opened this issue Oct 1, 2014 · 2 comments

Comments

@Globegitter
Copy link

Hi there, we are in the stage of moving our infrastructure over to a docker based system (using fig) and this approach with docker-gen and nginx seems like the last missing puzzle piece.

Right now we are using a nginx.conf similar to https://gist.github.com/Globegitter/45160dd3b151eeebfde2 and I was wondering, how could you modify the existing template to serve static files via nginx, as configured in the gist?

I am just starting to set up a test environment and warpping my head around everything, so might come up with a solution myself sometime over the next couple days but any hints would be appreciated.

@andrefernandes
Copy link
Owner

Can’t check it out if it works right now, but the nginx image itself has (a) a mount point for the static content (the “/usr/share/nginx/html” volume) and (b) a mount point for creating additional config files (the “/etc/nginx/sites-enabled” volume).

This is pretty much what the docker-gen image does: rewrites a config file at the “sites-enabled” mount.

You can go in several ways, but maybe the easiest (to start from) is to mount a host folder at the “html” volume.

Have fun!

De: Markus Padourek [mailto:[email protected]]
Enviada em: quarta-feira, 1 de outubro de 2014 09:18
Para: andrefernandes/docker-gen
Assunto: [docker-gen] Serving static assets (#1)

Hi there, we are in the stage of moving our infrastructure over to a docker based system (using fig) and this approach with docker-gen and nginx seems like the last missing puzzle piece.

Right now we are using a nginx.conf similar to https://gist.github.com/Globegitter/45160dd3b151eeebfde2 and I was wondering, how could you modify the existing template to serve static files via nginx, as configured in the gist?

I am just starting to set up a test environment and warpping my head around everything, so might come up with a solution myself sometime over the next couple days but any hints would be appreciated.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1.

@Globegitter
Copy link
Author

That would certainly be a possibility, but the idea was to have the node.js app in a separate container and there then exposing for example port 1337, nginx then reverse proxying all the incoming requests to port 80 to that container on port 1337 (I assume that is part of what this repository is trying to solve, right?).
Ideally I would also want the assets to be in that same, separate nodejs container and nginx would serve these through, I suppose, a mounted folder.

Thank you for the response, if you have some more recommendations great, if that is new territory for you as well no worries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants