Giter VIP home page Giter VIP logo

haproxy-acmesh-alpn's Introduction

haproxy-acmesh-alpn

This container provides an HAProxy instance with Let's Encrypt certificates generated at startup using acme.sh with the tls-alpn-01 method. This is useful if you can't use port 80 for verification.

Usage

Pull from Docker Hub:

docker pull mwohlert/haproxy-acmesh-alpn

Build from Dockerfile:

docker build -t haproxy-acmesh-alpn:latest .

Run container:

Example of run command (replace DOMAIN, TEST and volume paths with yours) Setting TEST to true will result in staging letsencrypt certificates, which is useful for testing.

docker run --name lb -d \
    -e DOMAINS=my.domain,my.other.domain \
    -e TEST=false \
    -v /srv/letsencrypt:/root/.acme.sh \
    -v /srv/haproxycfg/haproxy.cfg:/etc/haproxy/haproxy.cfg \
    --network my_network \
    -p 80:80 -p 443:443 \
    mwohlert/haproxy-acmesh-alpn:latest

Run with docker-compose:

Use the docker-compose.yml file in run directory (it creates 2 containers, the haproxy one and a nginx container linked in haproxy configuration for test purposes)

docker-compose.yml file contenct:

version: '3'
services:
    haproxy:
        container_name: lb
        environment:
            - DOMAINS=my.domain,my.other.domain
            - TEST=false
        volumes:
            - '$PWD/data/letsencrypt:/root/.acme.sh'
            - '$PWD/data/haproxy.cfg:/etc/haproxy/haproxy.cfg'
        networks:
            - lbnet
        ports:
            - '80:80'
            - '443:443'
        image: 'mwohlert/haproxy-acmesh-alpn:latest'
    nginx:
        container_name: www
        networks:
            - lbnet
        image: nginx

networks:
  lbnet:
  

docker-compose up -d

Renewal cron job

Every 2 months a cron job check for expiring certificates with certbot agent and reload haproxy if a certificate is renewed. No containers restart needed.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

haproxy-acmesh-alpn's People

Contributors

mwohlert avatar

Watchers

 avatar  avatar

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.