Created
November 16, 2025 16:07
-
-
Save dawidof/e75260e2830305a2f26307af2e080789 to your computer and use it in GitHub Desktop.
harbor and traefik
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| hostname: example-registry.com | |
| external_url: https://example-registry.com | |
| # http related config | |
| http: | |
| # port for http, default is 80. If https enabled, this port will redirect to https port | |
| port: 8080 | |
| # https related config | |
| # https: | |
| # # https port for harbor, default is 443 | |
| # port: 8443 | |
| # internal_tls: | |
| # enabled: false | |
| # # The path of cert and key files for nginx | |
| # #certificate: /your/certificate/path | |
| # #private_key: /your/private/key/path | |
| # # enable strong ssl ciphers (default: false) | |
| # # strong_ssl_ciphers: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3.8" | |
| services: | |
| traefik: | |
| image: traefik:v3.1 | |
| command: | |
| - "--api.dashboard=true" | |
| - "--providers.docker=true" | |
| - "--providers.file.directory=/etc/traefik/dynamic" | |
| - "--entrypoints.web.address=:80" | |
| - "--entrypoints.websecure.address=:443" | |
| - "--certificatesresolvers.le.acme.httpchallenge=true" | |
| - "--certificatesresolvers.le.acme.httpchallenge.entrypoint=web" | |
| - "[email protected]" | |
| - "--certificatesresolvers.le.acme.storage=/acme.json" | |
| ports: | |
| - "80:80" | |
| - "443:443" | |
| volumes: | |
| - "/var/run/docker.sock:/var/run/docker.sock:ro" | |
| - "./acme.json:/acme.json" | |
| - "./dynamic:/etc/traefik/dynamic" | |
| networks: | |
| - traefik | |
| - harbor | |
| networks: | |
| traefik: | |
| harbor: | |
| external: true | |
| name: harbor_harbor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http: | |
| routers: | |
| harbor-router: | |
| rule: "Host(`example-registry.com`)" | |
| entryPoints: ["websecure"] | |
| service: harbor-service | |
| tls: | |
| certResolver: le | |
| middlewares: | |
| - harbor-headers | |
| middlewares: | |
| harbor-headers: | |
| headers: | |
| customRequestHeaders: | |
| Host: example-registry.com | |
| X-Forwarded-Proto: https | |
| services: | |
| harbor-service: | |
| loadBalancer: | |
| servers: | |
| - url: "http://nginx:8080" # Harbor internal HTTP |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
here is working example of harbor show only beginning of config file with traefik (I needed to have on one ip and vps many projects with https)
replace example-registry.com with your domain, also in filename -- should be /