Sign inSign up

dock1100/haproxy-certbot

By dock1100

•Updated almost 8 years ago

HAProxy with Let'sEncrypt(Certbot) on Alpine Linux.

Image
1

50K+

dock1100/haproxy-certbot repository overview

⁠HAProxy with Certbot

Based on nmarus/docker-haproxy-certbot⁠ For detailed info see origin repo.

⁠Changes

  • Moved to Alpine Linux
  • Supervisord logging
  • Updated CertBot to >=0.22
  • Updated HAProxy to 1.8.8
  • Added check script (docker exec -it container_name haproxy-check -) < path_to_your_config

⁠Usage

⁠1. Create container
docker run -d \
  --restart=always \
  --name haproxy-certbot \
  --net=bridge \
  --cap-add=NET_ADMIN \
  -p 80:80 \
  -p 443:443 \
  -v /docker/haproxy/config:/config \
  -v /docker/haproxy/letsencrypt:/etc/letsencrypt \
  -v /docker/haproxy/certs.d:/usr/local/etc/haproxy/certs.d \
  -v /docker/haproxy/logs:/var/log/supervisord \
  dock1100/haproxy-certbot:latest
⁠2. Check config is valid
docker exec -it haproxy-certbot haproxy-check

or

docker run -it --rm \
  -v /docker/haproxy/config/haproxy.cfg:/haproxy.cfg:ro \
  -v /docker/haproxy/letsencrypt:/etc/letsencrypt \
  -v /docker/haproxy/certs.d:/usr/local/etc/haproxy/certs.d \
  --net=internal --name haproxy_check haproxy:alpine -c -f /haproxy.cfg
⁠3. Connect proxy to docker networks (to access other containers)
docker network connect my_custom_network haproxy-certbot
⁠4. Generate certificates
docker exec haproxy-certbot certbot-certonly \
  --domain example.com \
  --domain www.example.com \
  --email [email protected] \
  --dry-run
⁠5. Update certificates
docker exec haproxy-certbot certbot-renew && haproxy-refresh
⁠6. Check your browser

⁠Sample configs

For sample configs check haproxy.sample.cfg and docker-compose.sample.cfg

Tag summary

Content type

Image

Digest

Size

29.1 MB

Last updated

almost 8 years ago

docker pull dock1100/haproxy-certbot