From 8926685c11e816514c845380b68672d192f73848 Mon Sep 17 00:00:00 2001 From: Connor Nelson Date: Fri, 31 Mar 2023 23:22:45 +0000 Subject: [PATCH 1/2] Add docker registry --- docker-compose.yml | 7 +++++++ nginx-proxy/etc/nginx/vhost.d/default_location | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 49d014585..98b101cde 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -114,6 +114,13 @@ services: - ./data/dms/mail-logs:/var/log/mail - ./data/dms/config:/tmp/docker-mailserver + registry: + container_name: registry + restart: always + image: registry:2 + volumes: + - ./data/registry:/var/lib/registry + nginx: container_name: nginx image: nginxproxy/nginx-proxy diff --git a/nginx-proxy/etc/nginx/vhost.d/default_location b/nginx-proxy/etc/nginx/vhost.d/default_location index e9b54be9a..c7182c629 100644 --- a/nginx-proxy/etc/nginx/vhost.d/default_location +++ b/nginx-proxy/etc/nginx/vhost.d/default_location @@ -6,3 +6,17 @@ location /internal/ { proxy_http_version 1.1; proxy_pass $redirect_uri; # Use URI determined by back end } + +location /v2/ { + limit_except GET HEAD { + deny all; + } + + auth_basic off; + proxy_pass http://registry:5000; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 900; +} \ No newline at end of file From 403b6b4d402c368bab9cf211e202e95f8b9b286f Mon Sep 17 00:00:00 2001 From: Connor Nelson Date: Fri, 31 Mar 2023 23:23:39 +0000 Subject: [PATCH 2/2] Formatting --- nginx-proxy/etc/nginx/vhost.d/default_location | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx-proxy/etc/nginx/vhost.d/default_location b/nginx-proxy/etc/nginx/vhost.d/default_location index c7182c629..a8074cc53 100644 --- a/nginx-proxy/etc/nginx/vhost.d/default_location +++ b/nginx-proxy/etc/nginx/vhost.d/default_location @@ -19,4 +19,4 @@ location /v2/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 900; -} \ No newline at end of file +}