ByteBite Docs
Infrastructure

Traefik

Reverse proxy configuration, routers, wildcard routing, and host/container boundary.

Traefik

Traefik is the ByteBite edge reverse proxy. On staging it runs as the dokploy-traefik container managed by Dokploy, not as a Docker Swarm service.

Verified: 2026-09-08

Container

AttributeValue
Container namedokploy-traefik
Imagetraefik:v3.6.7
Restart policyalways
Networkdokploy-network
Command/entrypoint.sh traefik

Public bindings

PortProtocol
80TCP
443TCP
443UDP (HTTP/3)

Mounts

Host pathContainer pathMode
/etc/dokploy/traefik/traefik.yml/etc/traefik/traefik.yml
/etc/dokploy/traefik/dynamic/etc/dokploy/traefik/dynamic
/var/run/docker.sock/var/run/docker.sockread-only
/etc/dokploy/traefik/secrets/run/secretsread-only

The secrets mount supports DNS-01 wildcard TLS. Environment variable:

CF_DNS_API_TOKEN_FILE=/run/secrets/cloudflare-dns-api-token

The token file on the host is /etc/dokploy/traefik/secrets/cloudflare-dns-api-token (mode 600, owner root:root). Never document the token value.

Static configuration (traefik.yml)

Observed providers:

ProviderSettings
swarmenabled
dockerexposedByDefault: false, watch: true, network: dokploy-network
filedirectory: /etc/dokploy/traefik/dynamic, watch: true

Entry points:

NamePort
web80
websecure443

HTTP/3 advertised port: 443.

websecure default TLS resolver: letsencrypt.

Traefik API: insecure: true (static config fact). External accessibility of the API is not established — do not assume it is reachable from the internet.

Dynamic directory

Host path: /etc/dokploy/traefik/dynamic/

File / directoryPurpose
acme.jsonHTTP-01 ACME state (explicit hosts)
acme-cloudflare.jsonDNS-01 ACME state (wildcard)
dokploy.ymlDokploy management-domain router
middlewares.ymlredirect-to-https middleware
certificates/Additional certificate material

A temporary wildcard certificate probe router was removed after successful wildcard rollout. It is not a permanent architecture component.

TLS resolvers

ResolverChallengeStorageUsed for
letsencryptHTTP-01 (web entrypoint)acme.jsonExplicit Dokploy UI domains
letsencrypt-cloudflareDNS-01 (Cloudflare)acme-cloudflare.json*.staging.getbytebite.co wildcard

ACME email (both resolvers): info@berkearas.de

See TLS for certificate details.

Explicit routers (Dokploy-injected)

Dokploy injects Host() routers for domains configured in the UI. These use the letsencrypt HTTP-01 resolver and take precedence over wildcard routers.

Verified explicit hosts (2026-09-08): all return valid Let's Encrypt TLS with HTTP → HTTPS redirect.

Wildcard routers (compose.deploy.yml)

Dokploy cannot configure *.staging.getbytebite.co in the domain UI. Wildcard routing is defined via Docker labels on storefront and api.

Hostname rule

Runtime rule:

HostRegexp(`^[a-z0-9-]+[.]staging[.]getbytebite[.]co$`)

In compose.deploy.yml, the final $ is escaped as $$ because Docker Compose treats $ as variable interpolation. At runtime Traefik receives a single $.

Router inventory

Logical nameEntrypointPriorityMiddlewareTarget portTLS resolver
bytebite-staging-wildcard-webweb10redirect-to-https@filestorefront 3000
bytebite-staging-wildcard-storefrontwebsecure10storefront 3000letsencrypt-cloudflare
bytebite-staging-wildcard-apiwebsecure20bytebite-staging-wildcard-strip-api (StripPrefix /api)api 3001letsencrypt-cloudflare

There is no separate wildcard HTTP API router. The wildcard HTTP router redirects /api/* to HTTPS; the HTTPS API router handles API traffic.

Priority and precedence

Wildcard priorities are intentionally low (10 storefront, 20 API) so explicit Dokploy Host() routers remain preferred for reserved domains (api.staging…, docs.staging…, dashboard.staging…, seeded tenants).

The wildcard technically matches one-label staging hosts including reserved names, but explicit routes were verified to continue working after wildcard rollout.

TLS domain on wildcard routers

tls.domains[0].main = *.staging.getbytebite.co
certResolver = letsencrypt-cloudflare

Local Traefik (development)

Local dev uses a separate Traefik container (traefik:v3.4 in compose.yml) with the file provider only. Docker provider is disabled for OrbStack compatibility. Routing is defined in infrastructure/traefik/dev/dynamic.yml.

Host vs container configuration boundary

ConfigurationLocationSurvives app deploy?Survives Dokploy Traefik recreate?
Wildcard Traefik labelscompose.deploy.yml (Git)Yes (on redeploy)Yes
Explicit domain labelsDokploy UI / Preview ComposeYesYes
traefik.yml static configHost filesystemYesMay be lost if container recreated without remount
acme-cloudflare.jsonHost filesystemYesYes (file persists)
Cloudflare token fileHost filesystemYesMay be lost if secret mount not restored
CF_DNS_API_TOKEN_FILE envContainer configMay be lost on recreate

This is a critical operations concern. See Operations.

On this page