Giter Site home page Giter Site logo

alexander-krause-glau / rpi-docker-letsencrypt-nginx-proxy-companion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nginx-proxy/acme-companion

44.0 3.0 4.0 663 KB

RPI-compatible LetsEncrypt companion container for nginx-proxy

License: MIT License

Shell 96.70% Dockerfile 3.30%
nginx-proxy nginx-letsencrypt docker raspberrypi

rpi-docker-letsencrypt-nginx-proxy-companion's Introduction

This is a fork that enables usage on a armhf architecture (tested on RPI 3). Have a look at Yves Blusseau's original repository and README. The following part does not include all available options of the original project.

Why do you want to use this?

Reasons and examples for using a reverse proxy are discussed by Jason Wilder or here. With this companion container for automatically creating/renewing Let's Encrypt certificates you can host and expose your dockerized TLS-secured applications on a Raspberry Pi. Examples:

How to use

Built image is hosted on Dockerhub. Declare three writable volumes for the rpi-nginx-proxy container:

  • /etc/nginx/certs to create/renew Let's Encrypt certificates
  • /etc/nginx/vhost.d to change the configuration of vhosts (needed by Let's Encrypt)
  • /usr/share/nginx/html to write challenge files.

Exemplary usage:

  • First start nginx with the 3 volumes declared (you need to build this image as shown in the respective repository):
$ docker run -d -p 80:80 -p 443:443 \
    --name nginx-proxy \
    -v /path/to/certs:/etc/nginx/certs:ro \
    -v /etc/nginx/vhost.d \
    -v /usr/share/nginx/html \
    -v /var/run/docker.sock:/tmp/docker.sock:ro \
    --label com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy \
    alexanderkrause/rpi-nginx-proxy

The "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy" label is needed so that the letsencrypt container knows which nginx proxy container to use.

  • Second start this container:
$ docker run -d \
    --name nginx-letsencrypt \
    -v /usr/ssl:/etc/nginx/certs:rw \
    -v /var/run/docker.sock:/var/run/docker.sock:ro \
    --volumes-from nginx-proxy \
    alexanderkrause/rpi-letsencrypt-nginx-proxy-companion

Then start any containers you want proxied with a env var VIRTUAL_HOST=yourdomain.com, e.g.

$ docker run -d \
    --name example-app \
    -e "VIRTUAL_HOST=example.com" \
    -e "LETSENCRYPT_HOST=example.com" \
    -e "[email protected]" \
    tutum/apache-php

Regarding Certificate Aquiring

The acquiring of a certificate requires a nginx-reverse-proxy container with a mapping of the default ports, i.e., '80:80' and '443:443', as shown above. If you don't want to expose those ports, you need to apply a workaround:

Initially start a nginx-reverse-proxy container as shown below with those port mappings, then shutdown all three containers (reverse-proxy, companion and your application). Remove the reverse-proxy container and start a new one with your desired port mappings, e.g. '5050:80' and '5060:443'. Finally, start the companion and your application container.

How to build the image yourself

  1. Clone this repository $ git clone https://github.com/Alexander-Krause/rpi-docker-letsencrypt-nginx-proxy-companion.git
  2. $ cd rpi-docker-letsencrypt-nginx-proxy-companion
  3. $ docker build -t alexanderkrause/rpi-docker-letsencrypt-nginx-proxy-companion:latest .

DynDNS

Tested with duckdns as DynDNS provider. Configure the update url in your router or device (with ddclient) and (!) enable port forwarding (e.g. 443 of your Pi / docker container) in your router. Do the steps from above and enter yourducksubdomain.duckdns.org in VIRTUAL_HOST and LETSENCRYPT_HOST.

rpi-docker-letsencrypt-nginx-proxy-companion's People

Contributors

almereyda avatar bgarret avatar buchdag avatar emmetog avatar eralumin avatar greek64 avatar imaemo avatar jrcs avatar maltet avatar matthijskok avatar michaelsmithson avatar mickaelperrin avatar mjmayer avatar mrskensington avatar myoung34 avatar oscarkolsrud avatar panteparak avatar pini-gh avatar prodrigestivill avatar rathko avatar reldeis avatar remogloor avatar ryneeverett avatar silverfire avatar spiral-dev avatar teddybear06 avatar thmhoag avatar thomaco avatar thomseddon avatar xiamaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rpi-docker-letsencrypt-nginx-proxy-companion's Issues

update to ACMEv2 compatible client

Beginning June 1, 2020, Letzencrypt will stop allowing new domains to validate using
the ACMEv1 protocol.

your forked from JrCs/docker-letsencrypt-nginx-proxy-companion, which seems to be alredy using ACMEv2 client.

could you please update too.

...
using your image on rpi-3, best decision ever. thank you for your work

is posible to aceppt wildcard for letsencrypt?

I noticed recently that Letsencrypt accept wildcards, but I don´t know if this version of docker container can be configured via docker-compose.yml like this

    environment:
      - LETSENCRYPT_HOST="*.ctoadmin.mx"
      - [email protected]
      - PORT=8080
      - VIRTUAL_HOST="*.ctoadmin.mx"
    networks:
      - reverse-proxy
    restart: always

instead of:

LETSENCRYPT_HOST=portal1.mydomain.com,portal2.mydomain.com,portal3.mydomain.com
VIRTUAL_HOST=portal1.mydomain.com,portal2.mydomain.com,portal3.mydomain.com

And the second question where could I obtain the value for te TXT record:

Please deploy a DNS TXT record under the name
_acme-challenge.mydomain.com with the following value:
 
kzVNNLb5zvWxxiW30WbdD54OMYO5gbXRmqmpKPHihmQ
 
Before continuing, verify the record is deployed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.