Browse Source

Use host networking for nginx

pull/9/head
Chris Smith 8 years ago
parent
commit
a63ae7c355
1 changed files with 4 additions and 11 deletions
  1. 4
    11
      docker-compose.yml

+ 4
- 11
docker-compose.yml View File

104
       - etcd
104
       - etcd
105
 
105
 
106
   # Finally, nginx is what actually does the SSL termination and
106
   # Finally, nginx is what actually does the SSL termination and
107
-  # reverse proxying. If any containers to be proxied are on
108
-  # non-default networks, you'll need to specify them here and
109
-  # below in the top-level networks section.
110
-  #
111
-  # TODO: Redirect HTTP and add proper SSL options
107
+  # reverse proxying. Because it needs to connect to containers
108
+  # on (potentially) many different networks, we set the
109
+  # network_mode to host.
112
   nginx:
110
   nginx:
113
     image: nginx:1.9
111
     image: nginx:1.9
114
     container_name: autoproxy_nginx
112
     container_name: autoproxy_nginx
118
     ports:
116
     ports:
119
       - 80:80
117
       - 80:80
120
       - 443:443
118
       - 443:443
121
-    networks:
122
-      - default
123
-    # - mynetwork
119
+    network_mode: host
124
 
120
 
125
   # We use inotify-signal-container to monitor for nginx config
121
   # We use inotify-signal-container to monitor for nginx config
126
   # file and SSL cert changes (using inotify) and send nginx a
122
   # file and SSL cert changes (using inotify) and send nginx a
147
 
143
 
148
   etcd-services:
144
   etcd-services:
149
 
145
 
150
-  # To add pre-existing networks, mark them as 'external':
151
-  #mynetwork:
152
-  #  external: true

Loading…
Cancel
Save