# ============================================================================= # WOOO TECH - Docker Registry # 自建私有 Container Registry (取代 Harbor) # ============================================================================= # # 部署方式: # cd /home/wooo/registry # docker compose up -d # # 測試: # curl -u admin:password https://registry.wooo.work/v2/_catalog # # ============================================================================= version: '3.8' services: registry: image: registry:2 container_name: docker-registry restart: unless-stopped ports: - "127.0.0.1:5002:5000" # 僅本地連線,透過 Nginx 反向代理 (避免與 Harbor 衝突) volumes: - registry-data:/var/lib/registry - ./config.yml:/etc/docker/registry/config.yml:ro environment: - REGISTRY_STORAGE_DELETE_ENABLED=true - TZ=Asia/Taipei healthcheck: test: ["CMD", "wget", "-q", "--spider", "http://localhost:5000/v2/"] interval: 30s timeout: 10s retries: 3 networks: - registry-network logging: driver: "json-file" options: max-size: "10m" max-file: "3" # Registry UI (可選,提供 Web 介面) registry-ui: image: joxit/docker-registry-ui:latest container_name: docker-registry-ui restart: unless-stopped profiles: - ui # 使用 --profile ui 啟用 ports: - "127.0.0.1:5001:80" environment: - REGISTRY_TITLE=WOOO Registry - REGISTRY_URL=http://registry:5000 - SINGLE_REGISTRY=true - DELETE_IMAGES=true depends_on: - registry networks: - registry-network logging: driver: "json-file" options: max-size: "10m" max-file: "3" networks: registry-network: driver: bridge name: registry-network volumes: registry-data: name: docker-registry-data