version: '2.0'
services:
  registry:
    image: registry:2.7
    ports:
      - 5000:5000
    environment:
      REGISTRY_HTTP_ADDR: 0.0.0.0:5000
      REGISTRY_HTTP_TLS_CERTIFICATE: /var/docker-registry/registry-config/signed.crt
      REGISTRY_HTTP_TLS_KEY: /var/docker-registry/registry-config/domain.key
      REGISTRY_AUTH: htpasswd
      REGISTRY_AUTH_HTPASSWD_REALM: Registry
      REGISTRY_AUTH_HTPASSWD_PATH: /var/docker-registry/registry-config/htpasswd
      
 
    volumes:
      - ./registry-data:/var/lib/registry
      - ./registry-config/credentials.yml:/etc/docker/registry/config.yml
      - ./registry-config/htpasswd:/var/docker-registry/registry-config/htpasswd
      - ./registry-config/signed.crt:/var/docker-registry/registry-config/signed.crt
      - ./registry-config/domain.key:/var/docker-registry/registry-config/domain.key

  ui:
    image: joxit/docker-registry-ui:latest
    ports:
      - 8099:80
    environment:
      - REGISTRY_TITLE=ALGOMETIC Docker  # 自定义主页显示的Registry名称
      - REGISTRY_URL=https://192.168.1.118:5000 # 改成自己的IP，不建议使用localhost代替
      - SINGLE_REGISTRY=true
    depends_on:
      - registry

