Skip to content
This repository was archived by the owner on Jul 28, 2021. It is now read-only.

Not compatible with docker-compose files in version 2 #11

Open
tkaefer opened this issue May 28, 2016 · 2 comments
Open

Not compatible with docker-compose files in version 2 #11

tkaefer opened this issue May 28, 2016 · 2 comments

Comments

@tkaefer
Copy link

tkaefer commented May 28, 2016

I had some issues with docker-compose files in version 2, since there doesn't seem to be a IP address exposed.
The process literally just dies doe to an invalid forward syntax in the nginx default.conf.

Something like this:

upstream somedomain.tld {
                        # composecontext_nginx_1
                        server :80;
}
@evodicka
Copy link
Contributor

Yes, this is an issue with a each docker-compose file creating its own network when using the new version 2 syntax. The proxy cannot reach the other containers when using the default setup. There are already some discussions going on aroun the jwilder/nginx-proxy, which this is based on: nginx-proxy/nginx-proxy#337, nginx-proxy/nginx-proxy#304

I'm still not sure, if I like all the proposed solutions, but I will take a deeper look into this. If you like, you can try some of the solutions for yourself, if they are applicable to your setup.

@sopitz
Copy link
Contributor

sopitz commented Aug 17, 2016

You can create a network manually and then connect all your webservers that need to be reachable to this network too.
docker network ls--> that shows all your existing networks
docker network create <your-network> --> you can create a network called 'public' and then attach your webserver containers to that 'public' network as well.

Here's an example:

version: '2'
services:
   frontend-apache:
      image: "tutum/apache-php"
      networks:
         - public
         - backtier
      environment:
         - VIRTUAL_HOST=domain.de
   nginx-proxy:
       image: eforce21/letsencrypt-nginx-proxy:1.2.0
       container_name: nginx-proxy
       ports:
         - "80:80"
         - "443:443"
       volumes:
         - /var/run/docker.sock:/tmp/docker.sock:ro
       networks:
         - public
networks:
  public:
    external:
       name: public
  backtier:
    driver: bridge

That will set you up with a (default) jwilder/nginx and connect your webserver to the 'public' network. Then you should be able to use it with v2 docker-compose files as well.

#NOTE: This may compromise the security of your applications as suddenly they can all kind of communicate via the 'public' network. If that's not a problem for you, go for it.

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

No branches or pull requests

3 participants