Browse Source

Add container to HUP nginx on config change.

Define names for everything instead of using the default
compose names.
pull/9/head
Chris Smith 8 years ago
parent
commit
b6e676f7f3
1 changed files with 21 additions and 1 deletions
  1. 21
    1
      docker-compose.yml

+ 21
- 1
docker-compose.yml View File

23
   # a single node instance.
23
   # a single node instance.
24
   etcd:
24
   etcd:
25
     image: quay.io/coreos/etcd:v2.3.3
25
     image: quay.io/coreos/etcd:v2.3.3
26
+    container_name: autoproxy_etcd
26
     command: >-
27
     command: >-
27
       --name etcd0
28
       --name etcd0
28
       --initial-cluster etcd0=http://127.0.0.1:2380
29
       --initial-cluster etcd0=http://127.0.0.1:2380
39
   # in etcd up-to-date.
40
   # in etcd up-to-date.
40
   reporter:
41
   reporter:
41
     image: csmith/service-reporter:latest
42
     image: csmith/service-reporter:latest
43
+    container_name: autoproxy_reporter
42
     links:
44
     links:
43
       - etcd:etcd
45
       - etcd:etcd
44
     volumes:
46
     volumes:
53
   # the letsencrypt-* containers below.
55
   # the letsencrypt-* containers below.
54
   letsencrypt-updater:
56
   letsencrypt-updater:
55
     image: csmith/service-letsencrypt:latest
57
     image: csmith/service-letsencrypt:latest
58
+    container_name: autoproxy_letsencrypt-updater
56
     volumes:
59
     volumes:
57
       - letsencrypt-data:/letsencrypt
60
       - letsencrypt-data:/letsencrypt
58
     networks:
61
     networks:
65
   # need to set the provider and auth tokens below.
68
   # need to set the provider and auth tokens below.
66
   letsencrypt-lexicon:
69
   letsencrypt-lexicon:
67
     image: csmith/letsencrypt-lexicon:latest
70
     image: csmith/letsencrypt-lexicon:latest
71
+    container_name: autoproxy_letsencrypt-lexicon
68
     volumes:
72
     volumes:
69
       - letsencrypt-data:/letsencrypt
73
       - letsencrypt-data:/letsencrypt
70
     environment:
74
     environment:
91
   # proxying to the containers.
95
   # proxying to the containers.
92
   nginx-updater:
96
   nginx-updater:
93
     image: csmith/service-nginx:latest
97
     image: csmith/service-nginx:latest
98
+    container_name: autoproxy_nginx-updater
94
     volumes:
99
     volumes:
95
       - nginx-config:/nginx-config
100
       - nginx-config:/nginx-config
96
     networks:
101
     networks:
103
   # non-default networks, you'll need to specify them here and
108
   # non-default networks, you'll need to specify them here and
104
   # below in the top-level networks section.
109
   # below in the top-level networks section.
105
   #
110
   #
106
-  # TODO: Automatically reload config when changed
107
   # TODO: Redirect HTTP and add proper SSL options
111
   # TODO: Redirect HTTP and add proper SSL options
108
   nginx:
112
   nginx:
109
     image: nginx:1.9
113
     image: nginx:1.9
114
+    container_name: autoproxy_nginx
110
     volumes:
115
     volumes:
111
       - nginx-config:/etc/nginx/conf.d
116
       - nginx-config:/etc/nginx/conf.d
112
       - letsencrypt-data:/letsencrypt
117
       - letsencrypt-data:/letsencrypt
117
       - default
122
       - default
118
     # - mynetwork
123
     # - mynetwork
119
 
124
 
125
+  # We use inotify-signal-container to monitor for nginx config
126
+  # file and SSL cert changes (using inotify) and send nginx a
127
+  # SIGHUP signal.
128
+  nginx-config-hupper:
129
+    image: masm/inotify-signal-container:latest
130
+    container_name: autoproxy_nginx-config-hupper
131
+    volumes:
132
+      - nginx-config:/monitor/nginx
133
+      - letsencrypt-data:/monitor/letsencrypt
134
+      - /var/run/docker.sock:/var/run/docker.sock
135
+    command:
136
+      - autoproxy_nginx-proxy
137
+      - SIGHUP
138
+      - /monitor
139
+
120
 volumes:
140
 volumes:
121
 
141
 
122
   letsencrypt-data:
142
   letsencrypt-data:

Loading…
Cancel
Save