Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host ui and registry on traefik subpath / pathprefix #397

Open
MLB-BIOMETRIC opened this issue Sep 30, 2024 · 0 comments
Open

Host ui and registry on traefik subpath / pathprefix #397

MLB-BIOMETRIC opened this issue Sep 30, 2024 · 0 comments

Comments

@MLB-BIOMETRIC
Copy link

Hi!

I am having issues with hosting my the UI and the registry on subpaths using traefik. Does anyone know how to successfully do this?

The problem im facing is regarding the requests to the .css and .js files. With the following config i just get 404 not found when i visit /docker-ui

Below is my docker-compose:

services:
  
  # Traefik - reverse proxy

  traefik:
    image: traefik:v2.10.4
    command:
      - --api.dashboard=true
      - --api.insecure=true
      - --providers.docker
      - --log.level=INFO
      - --providers.file.directory=/certificates
      - --entryPoints.web.address=:80
      - --entryPoints.websecure.address=:443
      - --entrypoints.web.forwardedHeaders.insecure=true
      - --entrypoints.websecure.forwardedHeaders.insecure=true
    ports:
      - 80:80
      - 443:443
      - 8080:8080
    volumes:
      - //var/run/docker.sock:/var/run/docker.sock
      - D:\all_data\traefik\certificates:/certificates
    networks:
      - build03

  # Docker Image registry

  registry-ui:
    image: joxit/docker-registry-ui:main
    restart: always
    ports:
      - 5557:80
    dns:
      - "192.168.96.22"
      - "192.168.77.21"
    environment:
      - SINGLE_REGISTRY=true
      - REGISTRY_TITLE=Docker Registry UI
      - DELETE_IMAGES=true
      - SHOW_CONTENT_DIGEST=true
      - NGINX_PROXY_PASS_URL=http://registry-server:5000
      - SHOW_CATALOG_NB_TAGS=true
      - CATALOG_MIN_BRANCHES=1
      - CATALOG_MAX_BRANCHES=1
      - TAGLIST_PAGE_SIZE=100
      - REGISTRY_SECURED=false
      - CATALOG_ELEMENTS_LIMIT=1000
    labels:
      - "traefik.http.routers.registry-ui.rule=PathPrefix(`/docker-ui`)"
      - "traefik.http.routers.registry-ui.entrypoints=websecure"
      - "traefik.http.routers.registry-ui.tls=true"
    networks:
      - build03

  registry-server:
    image: registry:2.8.2
    restart: always
    environment:
      REGISTRY_HTTP_HEADERS_Access-Control-Allow-Origin: '[http://registry.example.com]'
      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,Cache-Control]'
      REGISTRY_HTTP_HEADERS_Access-Control-Expose-Headers: '[Docker-Content-Digest]'
      REGISTRY_STORAGE_DELETE_ENABLED: 'true'
    volumes:
      - D:\all_data\docker-registry\data:/var/lib/registry
    labels:
      - "traefik.http.routers.registry-server.rule=PathPrefix(`/docker-server`)"
      - "traefik.http.routers.registry-server.entrypoints=websecure"
      - "traefik.http.routers.registry-server.tls=true"
    ports:
      - 5000:5000
    dns:
      - "192.168.96.22"
      - "192.168.77.21"
    networks:
      - build03



networks:
  build03:
    driver: bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant