Skip to content

Instantly share code, notes, and snippets.

@marcelo-ochoa
Last active December 16, 2020 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcelo-ochoa/a6dc0eb30a1990018425a707204f0d47 to your computer and use it in GitHub Desktop.
Save marcelo-ochoa/a6dc0eb30a1990018425a707204f0d47 to your computer and use it in GitHub Desktop.
version: '3.6'
services:
registry:
image: registry:2
hostname: registry.mydomain.com
networks:
- lb_network
volumes:
- data:/var/lib/registry
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
labels:
- traefik.enable=true
- traefik.docker.network=lb_network
- traefik.constraint-label=traefik-public
- traefik.http.routers.reg-http.rule=Host(`registry.mydomain.com`) && (PathPrefix(`/v2`))
- traefik.http.routers.reg-http.entrypoints=http
- traefik.http.services.reg.loadbalancer.server.port=5000
registry-ui:
image: konradkleine/docker-registry-frontend:v2
networks:
- lb_network
environment:
- ENV_DOCKER_REGISTRY_HOST=registry.mydomain.com
- ENV_DOCKER_REGISTRY_PORT=443
- ENV_DOCKER_REGISTRY_USE_SSL=1
- ENV_MODE_BROWSE_ONLY=false
extra_hosts:
- "registry.mydomain.com:nn.nn.nn.nn"
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
labels:
- traefik.enable=true
- traefik.docker.network=lb_network
- traefik.constraint-label=traefik-public
- traefik.http.routers.regui-http.rule=Host(`registry.mydomain.com`)
- traefik.http.routers.regui-http.entrypoints=http
- traefik.http.services.regui.loadbalancer.server.port=80
volumes:
data:
driver: s3fs
name: "registry"
networks:
lb_network:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment