Files
asepharyana-hub/infra/traefik/TRAEFIK_ENV_CONFIG.md
T
asepharyanaandClaude Opus 4.8 f465ca261e refactor: clean up codebase — remove legacy references, optimize dockerfile, prune .env.example, simplify CI/CD
- Traefik: remove asephstech/asephscloud SSL certs, fix api.insecure, add ping healthcheck
- .env.example: prune from 145 to 30 vars (remove Firebase, Discord, Coolify, etc.)
- scraper.Dockerfile: remove Node.js & Chromium from runtime, add healthcheck
- CI/CD: remove orphan container ref, commented blocks, fix lint workflow
- infra: remove mysql config (no active service), clean up middleware config
- root: remove .nvmrc (dup), renovate.json (use dependabot), simplify Makefile
- scripts: fix legacy package refs, simplify update-deps to use bun
- docs: remove stale handoff-log, quality-gates, superpowers designs, archived files
- compose: add healthchecks to traefik, redis, and scraper-api services

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 13:27:45 +07:00

3.1 KiB

Traefik Environment Configuration

This document describes environment variables used to configure Traefik certificate and config paths in production deployments.

Certificate Path Environment Variables

All certificate paths support environment variable substitution with safe fallback defaults. This allows flexible certificate management across different deployment environments without modifying compose files.

Configuration Variables

Variable Description Default Path Purpose
TRAEFIK_CONFIG_PATH Directory containing dynamic Traefik configuration files (YAML) /root/asepharyana-hub/infra/traefik/dynamic Location of middleware, router, and service definitions
TRAEFIK_CERT_MY_ID_PEM Certificate file for asepharyana.my.id /root/asepharyana.my.id.pem SSL/TLS certificate for asepharyana.my.id domain
TRAEFIK_CERT_MY_ID_KEY Key file for asepharyana.my.id /root/asepharyana.my.id.key SSL/TLS private key for asepharyana.my.id domain
TRAEFIK_CERT_WEB_ID_PEM Certificate file for asepharyana.web.id /root/asepharyana.web.id.pem SSL/TLS certificate for asepharyana.web.id domain
TRAEFIK_CERT_WEB_ID_KEY Key file for asepharyana.web.id /root/asepharyana.web.id.key SSL/TLS private key for asepharyana.web.id domain

Usage

Default Behavior (Production)

If no environment variables are set, Traefik will use the default paths shown above. This is suitable for production deployments where certificates are installed at these standard locations.

docker compose -f infra/compose/traefik.yml up -d

Custom Paths (Custom Deployments)

To override paths for a custom deployment, set environment variables before starting services:

export TRAEFIK_CONFIG_PATH=/etc/traefik/custom-dynamic

docker compose -f infra/compose/traefik.yml up -d

Via .env File

Create or update your .env file in the deployment directory:

TRAEFIK_CONFIG_PATH=/root/asepharyana-hub/infra/traefik/dynamic
TRAEFIK_CERT_MY_ID_PEM=/root/asepharyana.my.id.pem
TRAEFIK_CERT_MY_ID_KEY=/root/asepharyana.my.id.key
TRAEFIK_CERT_WEB_ID_PEM=/root/asepharyana.web.id.pem
TRAEFIK_CERT_WEB_ID_KEY=/root/asepharyana.web.id.key

Then deploy:

docker compose --env-file .env -f infra/compose/traefik.yml up -d

Notes

  • All certificate paths use read-only mounts (:ro) for security
  • If a certificate file is missing at the specified path, Docker volume mounting will fail—ensure certificates exist before starting Traefik
  • The dynamic configuration directory must contain valid YAML files for Traefik to load properly