-
-
Save timoyuen/eea3d65f1b7fdc0c7db380bf792cab30 to your computer and use it in GitHub Desktop.
Docker registry behind traefik, see https://stackoverflow.com/a/51417561/1065654
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' | |
services: | |
frontproxy: | |
image: traefik | |
command: --api --docker | |
ports: | |
- "80:80" | |
- "443:443" | |
volumes: | |
- ./certs:/etc/ssl:ro | |
- ./traefik.toml:/etc/traefik/traefik.toml:ro | |
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events | |
labels: | |
- traefik.port=8080 | |
- traefik.frontend.rule=Host:traefik.domain.local | |
docker-registry: | |
image: registry:2 | |
labels: | |
- traefik.port=5000 # default port exposed by the registry | |
- traefik.frontend.rule=Host:registry.domain.local | |
- traefik.frontend.auth.basic=user:$$apr1$$9Cv/OMGj$$ZomWQzuQbL.3TRCS81A1g/ # user:password, see https://docs.traefik.io/configuration/backends/docker/#on-containers |
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
defaultEntryPoints = ["http", "https"] | |
# Redirect HTTP to HTTPS and use certificate, see https://docs.traefik.io/configuration/entrypoints/ | |
[entryPoints] | |
[entryPoints.http] | |
address = ":80" | |
[entryPoints.http.redirect] | |
entryPoint = "https" | |
[entryPoints.https] | |
address = ":443" | |
[entryPoints.https.tls] | |
[[entryPoints.https.tls.certificates]] | |
certFile = "/etc/ssl/domain.local.crt" | |
keyFile = "/etc/ssl/domain.local.key" | |
# Docker Swarm Mode Provider, see https://docs.traefik.io/configuration/backends/docker/#docker-swarm-mode | |
[docker] | |
endpoint = "tcp://127.0.0.1:2375" | |
domain = "docker.localhost" | |
watch = true | |
swarmMode = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment