haproxy
HAProxy with QUIC, ACME, and dynamic configuration support.
6.7K
A high-performance HAProxy Docker image with QUIC support, automated SSL/TLS certificate management, and flexible configuration options.
docker run -d \
--name haproxy \
-p 80:80 \
-p 443:443 \
-v /path/to/config:/config \
-e CF_Token=your-cloudflare-api-token \
-e CF_Account_ID=your-cloudflare-account-id \
-e CF_Zone_ID=your-cloudflare-zone-id \
-e [email protected] \
yourusername/haproxy:latest
version: '3.8'
services:
haproxy:
image: yourusername/haproxy:latest
ports:
- "80:80"
- "443:443"
volumes:
- ./config:/config
environment:
- CF_Token=${CF_Token}
- CF_Account_ID=${CF_Account_ID}
- CF_Zone_ID=${CF_Zone_ID}
- ACME_EMAIL=${ACME_EMAIL}
- ACME_CHALLENGE_TYPE=dns_cf
- CONFIG_AUTO_GENERATE_DEBUG=false
restart: unless-stopped
| Variable | Required | Default | Description |
|---|---|---|---|
| ACME_EMAIL | Yes | - | Email for Let's Encrypt registration |
| ACME_CHALLENGE_TYPE | No | dns_cf | Challenge type (dns_cf/http) |
| DEBUG | No | false | Enable debug logging |
| TZ | No | UTC | Container timezone |
You can use either the newer API Token method or the legacy API Key method:
API Token Method (Recommended):
CF_Token, CF_Account_ID, CF_Zone_IDLegacy API Key Method:
CF_Email, CF_Key| Path | Purpose |
|---|---|
| your_dir:/config | Configuration files, certificates, and YAML configuration |
| your_log_dir:/var/log/haproxy | HAProxy access and error logs |
| Port | Protocol | Description |
|---|---|---|
| 80 | TCP | HTTP traffic and ACME challenges |
| 443 | TCP | HTTPS traffic |
| 443 | UDP | QUIC protocol (HTTP/3) |
security_options:
- no-new-privileges:true
- seccomp=unconfined
Create Cloudflare API Token:
Zone:DNS:Edit permissionsConfigure Environment:
export CF_Token=your_token
export CF_Account_ID=your_cf_account_id
export export CF_Zone_ID=your_cf_zone_id
# Alternative Cloudflare settings
export CF_Key=your_cf_key
export CF_Email=your_cf_email
Configure Environment:
-e ACME_CHALLENGE_TYPE=http \
-e [email protected]
Ensure Port 80 is Accessible:
-p 80:80
Place custom certificates in /config/acme/certs/:
/config/acme/certs/
├── example.com.pem
├── example.com.key
└── example.com.chain
Default healthcheck configuration:
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD /usr/local/bin/healthcheck.sh
Certificate Issues:
# Check ACME logs
docker exec haproxy cat /var/log/acme-renewals.log
HAProxy Startup Failures:
# Check HAProxy logs
docker exec haproxy cat /var/log/haproxy/haproxy.log
Configuration Errors:
# Validate configuration
docker exec haproxy haproxy -c -f /config/haproxy.cfg
Enable debug logging:
-e DEBUG=true
Content type
Image
Digest
sha256:95cad9cfb…
Size
89.1 MB
Last updated
about 1 month ago
docker pull brycelarge/haproxy:3.4.0