š¢ Hardened Traefik Proxy setup for Docker/Podman with automated local PKI/SSL engine.
1.1K
Hardened rootless Traefik image built on Alpine Linux with automated local PKI/OpenSSL generation and runtime config macro bootstrapping.
This image is designed for secure local development and production web application routing, running entirely without root
privileges (uid:gid 1000:1000).
š GitHub Repository & Full Configuration Guides: github.com/crasivo/traefik-composeā
traefik user (UID/GID 1000), eliminating host takeover
risks via container escape.localhost, fallbacks, and custom wildcard domains via env).To use this image via docker-compose.yml with secure socket proxying, you can use the following minimal blueprint:
name: traefik
services:
traefik:
image: crasivo/traefik:latest
container_name: traefik
restart: always
deploy:
resources:
limits:
cpus: 0.5
memory: 1G
environment:
- "TRAEFIK_PROVIDERS_DOCKER_ENDPOINT=unix:///var/run/docker.sock"
- "TRAEFIK_PROVIDERS_DOCKER_NETWORK=${TRAEFIK_PUBLIC_NETWORK:-traefik_public}"
- "VIRTUAL_HOST=${TRAEFIK_PUBLIC_HOST:-traefik.docker}"
hostname: "${TRAEFIK_PUBLIC_HOST:-traefik.docker}"
networks:
public:
aliases:
- "${TRAEFIK_PUBLIC_HOST:-traefik.docker}"
ports:
- "80:80" # HTTP
- "443:443" # HTTPS
volumes:
- ./volumes/traefik_config:/etc/traefik
- ./volumes/traefik_certs:/opt/docker/share/openssl
- /var/run/docker.sock:/var/run/docker.sock:ro
healthcheck:
test: [ "CMD", "/usr/local/bin/traefik", "healthcheck", "--ping" ]
interval: 10s
timeout: 2s
retries: 3
start_period: 5s
labels:
- "traefik.enable=true"
# Route: HTTPS
- "traefik.http.routers.traefik-api-https.rule=Host(`${TRAEFIK_PUBLIC_HOST:-traefik.docker}`)"
- "traefik.http.routers.traefik-api-https.entryPoints=https"
- "traefik.http.routers.traefik-api-https.tls=true"
- "traefik.http.routers.traefik-api-https.service=api@internal"
networks:
public:
external: true
name: "${TRAEFIK_PUBLIC_NETWORK:-traefik_public}"
Note for Podman/RHEL users: Remember to swap the host socket path to your runtime user space
directory (/run/user/1000/podman/podman.sock) and append the :z or :Z flags for SELinux compliance.
At every startup, the built-in openssl-generate.sh script automatically provisions a custom Crasivo Root CA alongside valid
dynamic wildcard SSL certificates.
To get a "green lock" in your browser and avoid SSL Handshake Error warnings in your terminal, copy the generated root
certificate from the container's mounted volume (/etc/traefik/certs/root/certificate.pem) and add it to your host machine trust
store:
certificate.pem -> Add to Keychain Access -> Set to Always Trust./usr/local/share/ca-certificates/Crasivo_Root_CA.crt and run sudo update-ca-certificates.certificate.pem manually via Settings -> Certificates -> Authorities.For detailed guides regarding:
2375).Linger states, and systemd user services).dnsmasq**.Please refer to the detailed documentation and scripts available in the original source code repository.
š Documentation & Source: crasivo/traefik-composeā
š License: MITā
Content type
Image
Digest
sha256:2dd1d1f2dā¦
Size
49.8 MB
Last updated
2 days ago
docker pull crasivo/traefik