version: '3.8'

services:
  docker-registry:
    image: registry:2.8.3
    container_name: docker-registry
    ports:
      - "5000:5000"
    environment:
      - REGISTRY_HTTP_HEADERS_Access-Control-Allow-Origin=[http://localhost:8081]
      - REGISTRY_HTTP_HEADERS_Access-Control-Allow-Methods=[HEAD,GET,OPTIONS,DELETE]
      - REGISTRY_HTTP_HEADERS_Access-Control-Allow-Credentials=[true]
      - REGISTRY_HTTP_HEADERS_Access-Control-Allow-Headers=[Authorization,Accept,Origin,Destination,Content-Type,Docker-Content-Digest]
      - REGISTRY_HTTP_HEADERS_Access-Control-Expose-Headers=[Docker-Content-Digest]
    volumes:
      - ./data:/var/lib/registry
    restart: unless-stopped

  registry-ui:
    image: joxit/docker-registry-ui:latest
    container_name: registry-ui
    ports:
      - "8081:80"
    environment:
      - REGISTRY_URL=http://docker-registry:5000
    depends_on:
      - docker-registry
    restart: unless-stopped

