services: registry: image: registry:2 container_name: registry restart: unless-stopped environment: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry # Optional but recommended if you want to be able to delete images: REGISTRY_STORAGE_DELETE_ENABLED: "true" # Listen only inside the compose network REGISTRY_HTTP_ADDR: 0.0.0.0:5000 volumes: - ./registry:/var/lib/registry expose: - "5000" # internal only, not published nginx: image: nginx:alpine container_name: nginx restart: unless-stopped depends_on: - registry ports: - "443:443" # HTTPS only - "4443:4443" # deliberately no "80:80" – no HTTP volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro - /etc/registry/certs:/etc/registry/certs:ro - /etc/registry/auth/.htpasswd:/etc/nginx/.htpasswd:ro - /var/log/nginx:/var/log/nginx