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,6 +23,7 @@ services:
23 23
   # a single node instance.
24 24
   etcd:
25 25
     image: quay.io/coreos/etcd:v2.3.3
26
+    container_name: autoproxy_etcd
26 27
     command: >-
27 28
       --name etcd0
28 29
       --initial-cluster etcd0=http://127.0.0.1:2380
@@ -39,6 +40,7 @@ services:
39 40
   # in etcd up-to-date.
40 41
   reporter:
41 42
     image: csmith/service-reporter:latest
43
+    container_name: autoproxy_reporter
42 44
     links:
43 45
       - etcd:etcd
44 46
     volumes:
@@ -53,6 +55,7 @@ services:
53 55
   # the letsencrypt-* containers below.
54 56
   letsencrypt-updater:
55 57
     image: csmith/service-letsencrypt:latest
58
+    container_name: autoproxy_letsencrypt-updater
56 59
     volumes:
57 60
       - letsencrypt-data:/letsencrypt
58 61
     networks:
@@ -65,6 +68,7 @@ services:
65 68
   # need to set the provider and auth tokens below.
66 69
   letsencrypt-lexicon:
67 70
     image: csmith/letsencrypt-lexicon:latest
71
+    container_name: autoproxy_letsencrypt-lexicon
68 72
     volumes:
69 73
       - letsencrypt-data:/letsencrypt
70 74
     environment:
@@ -91,6 +95,7 @@ services:
91 95
   # proxying to the containers.
92 96
   nginx-updater:
93 97
     image: csmith/service-nginx:latest
98
+    container_name: autoproxy_nginx-updater
94 99
     volumes:
95 100
       - nginx-config:/nginx-config
96 101
     networks:
@@ -103,10 +108,10 @@ services:
103 108
   # non-default networks, you'll need to specify them here and
104 109
   # below in the top-level networks section.
105 110
   #
106
-  # TODO: Automatically reload config when changed
107 111
   # TODO: Redirect HTTP and add proper SSL options
108 112
   nginx:
109 113
     image: nginx:1.9
114
+    container_name: autoproxy_nginx
110 115
     volumes:
111 116
       - nginx-config:/etc/nginx/conf.d
112 117
       - letsencrypt-data:/letsencrypt
@@ -117,6 +122,21 @@ services:
117 122
       - default
118 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 140
 volumes:
121 141
 
122 142
   letsencrypt-data:

Loading…
Cancel
Save