SUSE / Portus

Authorization service and frontend for Docker registry (v2)
http://port.us.org/
Apache License 2.0
3k stars 471 forks source link

Serving static files from bare-metal nginx #2303

Closed phrfpeixoto closed 2 years ago

phrfpeixoto commented 4 years ago

Description

Hi,

I have an existing server running nginx in bare-metal, and I'm deploying Portus on it. I wanted to have that nginx daemon serve the static files, but since I'm deploying Portus from docker-compose I'm facing some issues with accessibility.

The static volume is being mounted on /var/lib/docker/volumes/registry_static/_data, which nginx cannot read

Would you have a work around?

Steps to reproduce

  1. use this compose file: https://gist.github.com/phrfpeixoto/02080a601af9dbfad6e9ace920c0ae8d
  2. Use the provided nginx config, and point root to /var/lib/docker/volumes/registry_static/_data
  3. static files are unreachable
dzhgenti commented 3 years ago

Hey folks,

I'm also interested in this kind of setup.

I tried removing location block serving assets, hoping that portus will handle these requests but no luck.

 location ~ ^/(assets)/ {
        access_log off;
        gzip_static on;
        expires max;
        add_header Cache-Control public;
        add_header Last-Modified "";
        add_header ETag "";
        break;
    }
stale[bot] commented 3 years ago

Thanks for all your contributions! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.