version: '3.7'

networks:
  proxy:
    external: true

volumes:
  registry:
    name: registry

services:
  registry:
    image: registry:2
    container_name: registry
    environment:
      REGISTRY_AUTH: htpasswd
      REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
      REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
    networks:
      - proxy
    volumes:
      - registry:/var/lib/registry
      - ./auth.secrets:/auth/htpasswd
    labels:
      traefik.http.routers.registry.entrypoints: websecure
      traefik.http.routers.registry.rule: Host(`registry.picasoft.net`)
      traefik.http.services.registry.loadbalancer.server.port: 5000
      traefik.enable: true
    restart: unless-stopped
