diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..1c03166 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,15 @@ +--- +kind: pipeline +name: default +type: docker + +steps: +- name: docker + image: plugins/docker + settings: + repo: yavook/kiwi-nginx-gen + auto_tag: true + username: + from_secret: DOCKER_USERNAME + password: + from_secret: DOCKER_PASSWORD diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4d31858 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM nginxproxy/docker-gen +LABEL maintainer="jmm@yavook.de" + +LABEL com.github.jrcs.letsencrypt_nginx_proxy_companion.docker_gen="true" + +ADD \ + https://raw.githubusercontent.com/nginx-proxy/nginx-proxy/main/nginx.tmpl \ + /etc/docker-gen/templates/nginx.tmpl + +CMD [ \ + "-notify-sighup", "nginx", \ + "-watch", \ + "-wait", "5s:30s", \ + "/etc/docker-gen/templates/nginx.tmpl", \ + "/etc/nginx/conf.d/default.conf" \ +] diff --git a/README.md b/README.md index 9a3c203..adf41db 100644 --- a/README.md +++ b/README.md @@ -1 +1,71 @@ -# kiwi-nginx-gen \ No newline at end of file +# kiwi-nginx-gen + +[![Build Status](https://github.drone.yavook.de/api/badges/yavook/kiwi-nginx-gen/status.svg)](https://github.drone.yavook.de/yavook/kiwi-nginx-gen) + +> `kiwi` - simple, consistent, powerful + +Utility for [`kiwi-scp`](https://github.com/yavook/kiwi-scp). Also [on Docker Hub](https://hub.docker.com/r/yavook/kiwi-nginx-gen). + +## Use Case + +kiwi-nginx-gen is used in the multi-container use case alongside an official `nginx` container to mimic `nginxproxy/nginx-proxy` without publishing your docker socket to the `nginx` container. + +## Typical usage in `docker-compose.yml` sections: + +Without TLS: + +```yaml +nginx: + image: nginx:stable-alpine + container_name: nginx + network_mode: host + volumes: + - "${KIWI_PROJECT}/nginx/conf.d:/etc/nginx/conf.d:ro" + +nginx-gen: + build: yavook/kiwi-nginx-gen + networks: + - kiwi_hub + depends_on: + - nginx + volumes: + - "/var/run/docker.sock:/tmp/docker.sock:ro" + - "${KIWI_PROJECT}/nginx/conf.d:/etc/nginx/conf.d" +``` + +With automatic TLS by Let's Encrypt: + +```yaml +nginx: + image: nginx:stable-alpine + container_name: nginx + labels: + com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: 'true' + network_mode: host + volumes: + - "${KIWI_PROJECT}/nginx/certs:/etc/nginx/certs:ro" + - "${KIWI_PROJECT}/nginx/conf.d:/etc/nginx/conf.d:ro" + +nginx-gen: + build: yavook/kiwi-nginx-gen + networks: + - kiwi_hub + depends_on: + - nginx + volumes: + - "/var/run/docker.sock:/tmp/docker.sock:ro" + - "${KIWI_PROJECT}/nginx/certs:/etc/nginx/certs:ro" + - "${KIWI_PROJECT}/nginx/conf.d:/etc/nginx/conf.d" + +letsencrypt: + image: nginxproxy/acme-companion + depends_on: + - nginx-gen + volumes: + - "/var/run/docker.sock:/var/run/docker.sock:ro" + - "${KIWI_PROJECT}/nginx/certs:/etc/nginx/certs" + - "${KIWI_PROJECT}/nginx/conf.d:/etc/nginx/conf.d:ro" + - "${KIWI_PROJECT}/nginx/acme.sh:/etc/acme.sh" + environment: + DEFAULT_EMAIL: "${LE_MAIL_DEFAULT}" +```