Skip to content

Commit 6e67ad0

Browse files
Donovan Mullerdonovanmuller
authored andcommitted
Added Docker Cloud support
1 parent 1ea4335 commit 6e67ad0

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,12 @@ RUN chmod +rx /app/install_simp_le.sh && sync && /app/install_simp_le.sh && rm -
2222
ENTRYPOINT ["/bin/bash", "/app/entrypoint.sh" ]
2323
CMD ["/bin/bash", "/app/start.sh" ]
2424

25+
# From https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md#example
26+
RUN apk add --update \
27+
python \
28+
py-pip \
29+
&& pip install virtualenv \
30+
&& pip install docker-cloud \
31+
&& rm -rf /var/cache/apk/*
32+
2533
COPY /app/ /app/

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
[![](https://images.microbadger.com/badges/version/jrcs/letsencrypt-nginx-proxy-companion.svg)](https://hub.docker.com/r/jrcs/letsencrypt-nginx-proxy-companion "Click to view the image on Docker Hub")
2-
[![](https://images.microbadger.com/badges/image/jrcs/letsencrypt-nginx-proxy-companion.svg)](https://hub.docker.com/r/jrcs/letsencrypt-nginx-proxy-companion "Click to view the image on Docker Hub")
3-
[![](https://img.shields.io/docker/stars/jrcs/letsencrypt-nginx-proxy-companion.svg)](https://hub.docker.com/r/jrcs/letsencrypt-nginx-proxy-companion "Click to view the image on Docker Hub")
4-
[![](https://img.shields.io/docker/pulls/jrcs/letsencrypt-nginx-proxy-companion.svg)](https://hub.docker.com/r/jrcs/letsencrypt-nginx-proxy-companion "Click to view the image on Docker Hub")
1+
# Docker Cloud Support
2+
3+
This fork adds Docker Cloud support to `docker-letsencrypt-nginx-proxy-companion`.
4+
5+
The only differences are in [`functions.sh`](app/functions.sh) to the `reload_nginx()`
6+
function where the [`docker_kill`](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/blob/master/app/functions.sh#L75) function call is replaced by the use of the `docker-cloud` CLI to redeploy
7+
the Service referenced by `NGINX_DOCKER_GEN_CONTAINER`. In using the `docker-cloud`
8+
CLI, we need to add it to the `docker-letsencrypt-nginx-proxy-companion` image
9+
via the `Dockerfile`.
10+
11+
See [this](https://blog.switchbit.io/developing-a-ghost-theme-with-gulp-part-5/) blog post for more context.
12+
13+
---
514

615
letsencrypt-nginx-proxy-companion is a lightweight companion container for the [nginx-proxy](https://github.com/jwilder/nginx-proxy). It allow the creation/renewal of Let's Encrypt certificates automatically. See [Let's Encrypt section](#lets-encrypt) for configuration details.
716

app/functions.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ function docker_kill {
7171
reload_nginx() {
7272
if [[ -n "${NGINX_DOCKER_GEN_CONTAINER:-}" ]]; then
7373
# Using docker-gen separate container
74-
echo "Reloading nginx proxy (using separate container ${NGINX_DOCKER_GEN_CONTAINER})..."
75-
docker_kill "$NGINX_DOCKER_GEN_CONTAINER" SIGHUP
74+
echo "Redeploying nginx proxy (using separate container ${NGINX_DOCKER_GEN_CONTAINER})..."
75+
docker_gen_service=`docker-cloud service ps --status Running | grep "^${NGINX_DOCKER_GEN_CONTAINER}" | awk '{print $2}'`
76+
docker-cloud service redeploy --sync $docker_gen_service
7677
else
7778
if [[ -n "${NGINX_PROXY_CONTAINER:-}" ]]; then
7879
echo "Reloading nginx proxy..."

0 commit comments

Comments
 (0)