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

Usage with separate nginx and docker-gen container #12

Closed
konstantinj opened this issue Jan 24, 2016 · 13 comments
Closed

Usage with separate nginx and docker-gen container #12

konstantinj opened this issue Jan 24, 2016 · 13 comments
Labels
kind/question Issue that might be transferred to Discussions

Comments

@konstantinj
Copy link

Hi,

thanks for this awesome image - exactly what I was looking for. Unfortunately it's not working with my configuration. I'm using docker-compose and I have a separate nginx container and docker-gen in its own container so I can modify the nginx config template.

I'm getting this error on start:

,sh: 1: /usr/local/bin/docker-gen: not found

How is this image supposed to work?

@JrCs
Copy link
Collaborator

JrCs commented Jan 24, 2016

My container call the nginx proxy container to recreate the nginx configuration with docker-gen.
Why don't you use the original nginx-proxy container with docker-gen in it ?
If you need to change the template that is used to create the nginx configuration you can mount bind the nginx.tpl with your configuration.

@JrCs JrCs added the kind/question Issue that might be transferred to Discussions label Jan 24, 2016
@konstantinj
Copy link
Author

The default nginx-proxy container is using the /app/nginx.tmpl file which I can't overwrite with a mount. Also by using nginx separately I can use a newer version and the docker socket won't be exposed publicly.

@bobmaerten
Copy link

Exactly my setup, @konstantinj. I'll try installing/using the @JrCs image to get it running, and I'll report back here then.

@JrCs
Copy link
Collaborator

JrCs commented Jan 26, 2016

To use my container we need to know the container id of the docker-gen container.
@konstantinj is your docker-gen container do an nginx reload ? if yes how ?

@konstantinj
Copy link
Author

In the readme from https://github.com/jwilder/nginx-proxy it says that the nginx container must be named "nginx". So I guess that's how docker-gen can reload nginx. So it should work the same with your container I guess when the container name is hard "docker-gen".

@bobmaerten
Copy link

Well, no luck with containerized docker-gen, so I switch back on default nginx-proxy for now.

@JrCs
Copy link
Collaborator

JrCs commented Jan 27, 2016

@konstantinj no the docker-gen command of the nginx-proxy call directly the nginx reload command (they are in the same container)

@konstantinj
Copy link
Author

Yes, when using nginx-proxy image. But in my case, when using docker-gen image and nginx image separately, docker-gen is reloading nginx in the other container.

@JrCs
Copy link
Collaborator

JrCs commented Jan 27, 2016

How the docker-gen image reload the nginx in the other container ?

@bobmaerten
Copy link

@JrCs docker-gen tool has a -notify-sighup <container_name> flag to do some sort of kill -HUP to the container.

@mpatton125
Copy link

I have this working (for the most part) with minimal code changes, with official nginx image and docker-gen 0.5.0. Everything is working as expected getting certs etc. The only bump I currently have is that docker-gen command run in the docker-gen container doesn't seem to exit properly (or in fact, at all).

So while the LE companion container does it's work correctly and fires off the docker-gen command followed by the nginx container HUP, the docker-gen command never exits so the LE container sits there doing nothing, waiting for it. :( I have raised an issue with docker-gen and will see what is said.

@JrCs
Copy link
Collaborator

JrCs commented Feb 6, 2016

A PR #20 is open to fix this issue.

@konstantinj
Copy link
Author

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Issue that might be transferred to Discussions
Projects
None yet
Development

No branches or pull requests

4 participants