From c6987b3ea050cd2b4e97b8a9480aa1130bbecd68 Mon Sep 17 00:00:00 2001 From: Nicolas Duchon Date: Sun, 22 Dec 2024 20:50:57 +0100 Subject: [PATCH] test: separate containers (contd) --- .../test_acme_challenge_location_disabled.yml | 3 +- test/test_ssl/test_cert_selection.yml | 73 +++++++++++++------ test/test_ssl/test_hsts.yml | 30 +++++++- test/test_ssl/test_https_port.yml | 37 +++++++++- test/test_ssl/test_nohttp.yml | 34 ++++++++- test/test_ssl/test_nohttps.yml | 30 +++++++- test/test_ssl/test_noredirect.yml | 34 ++++++++- test/test_ssl/test_virtual_path.yml | 34 ++++++++- test/test_ssl/test_wildcard.yml | 34 ++++++++- .../test_default.yml | 34 ++++++++- .../test_disabled.yml | 39 ++++++++-- .../test_enabled.yml | 39 ++++++++-- .../test_predictable-name.yml | 26 ++++++- test/test_upstream-name/test_sha1-name.yml | 29 +++++++- test/test_vhost-empty-string.yml | 26 ++++++- test/test_vhost-in-multiple-networks.yml | 39 ++++++++-- test/test_virtual-path/test_custom_conf.yml | 43 +++++++++-- .../test_default-root-none.yml | 29 +++++++- test/test_virtual-path/test_forwarding.yml | 35 ++++++++- .../test_location_precedence.yml | 38 +++++++++- test/test_virtual-path/test_virtual_paths.yml | 26 ++++++- test/test_wildcard_host.yml | 26 ++++++- 22 files changed, 653 insertions(+), 85 deletions(-) diff --git a/test/test_acme_http_challenge_location/test_acme_challenge_location_disabled.yml b/test/test_acme_http_challenge_location/test_acme_challenge_location_disabled.yml index dc171af..257e355 100644 --- a/test/test_acme_http_challenge_location/test_acme_challenge_location_disabled.yml +++ b/test/test_acme_http_challenge_location/test_acme_challenge_location_disabled.yml @@ -54,8 +54,7 @@ services: profiles: - separateContainers image: nginxproxy/nginx-proxy:test-dockergen - environment: - <<: *nginxProxyEnv + environment: *nginxProxyEnv volumes: - &confVolume nginx_conf:/etc/nginx/conf.d - *dockerSocket diff --git a/test/test_ssl/test_cert_selection.yml b/test/test_ssl/test_cert_selection.yml index 6b4824c..5ab11bb 100644 --- a/test/test_ssl/test_cert_selection.yml +++ b/test/test_ssl/test_cert_selection.yml @@ -1,33 +1,62 @@ +volumes: + nginx_conf: + + services: - base: - image: web - environment: - WEB_PORTS: "80" - VIRTUAL_HOST: "nginx-proxy.tld" + base: + image: web + environment: + WEB_PORTS: "80" + VIRTUAL_HOST: "nginx-proxy.tld" www: - image: web - environment: - WEB_PORTS: "80" - VIRTUAL_HOST: "www.nginx-proxy.tld" - + image: web + environment: + WEB_PORTS: "80" + VIRTUAL_HOST: "www.nginx-proxy.tld" + sub-www: - image: web - environment: - WEB_PORTS: "80" - VIRTUAL_HOST: "subdomain.www.nginx-proxy.tld" + image: web + environment: + WEB_PORTS: "80" + VIRTUAL_HOST: "subdomain.www.nginx-proxy.tld" web1: - image: web - environment: - WEB_PORTS: "80" - VIRTUAL_HOST: "web1.nginx-proxy.tld" + image: web + environment: + WEB_PORTS: "80" + VIRTUAL_HOST: "web1.nginx-proxy.tld" sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./cert_selection:/etc/nginx/certs:ro - - ./acme_root:/usr/share/nginx/html:ro - environment: + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &certs ./cert_selection:/etc/nginx/certs:ro + - &acmeRoot ./acme_root:/usr/share/nginx/html:ro + environment: &nginxProxyEnv DEBUG_ENDPOINT: "true" + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *certs + - *acmeRoot + environment: *nginxProxyEnv + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *certs + - *acmeRoot + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_ssl/test_hsts.yml b/test/test_ssl/test_hsts.yml index d0adf8f..39599a9 100644 --- a/test/test_ssl/test_hsts.yml +++ b/test/test_ssl/test_hsts.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web1: image: web @@ -46,7 +50,29 @@ services: com.github.nginx-proxy.nginx-proxy.http3.enable: "true" sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./certs:/etc/nginx/certs:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &certs ./cert_selection:/etc/nginx/certs:ro + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *certs + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *certs + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_ssl/test_https_port.yml b/test/test_ssl/test_https_port.yml index 0ecfc76..54a8cc9 100644 --- a/test/test_ssl/test_https_port.yml +++ b/test/test_ssl/test_https_port.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web1: image: web @@ -8,11 +12,36 @@ services: VIRTUAL_HOST: "*.nginx-proxy.tld" sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./certs:/etc/nginx/certs:ro - - ./acme_root:/usr/share/nginx/html:ro - environment: + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &certs ./certs:/etc/nginx/certs:ro + - &acmeRoot ./acme_root:/usr/share/nginx/html:ro + environment: &nginxProxyEnv HTTP_PORT: 8080 HTTPS_PORT: 8443 + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *certs + - *acmeRoot + environment: *nginxProxyEnv + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *certs + - *acmeRoot + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_ssl/test_nohttp.yml b/test/test_ssl/test_nohttp.yml index 3c44ee4..f0b3682 100644 --- a/test/test_ssl/test_nohttp.yml +++ b/test/test_ssl/test_nohttp.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web2: image: web @@ -9,8 +13,32 @@ services: HTTPS_METHOD: nohttp sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./certs:/etc/nginx/certs:ro - - ./acme_root:/usr/share/nginx/html:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &certs ./certs:/etc/nginx/certs:ro + - &acmeRoot ./acme_root:/usr/share/nginx/html:ro + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *certs + - *acmeRoot + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *certs + - *acmeRoot + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_ssl/test_nohttps.yml b/test/test_ssl/test_nohttps.yml index c0ca38b..085eac3 100644 --- a/test/test_ssl/test_nohttps.yml +++ b/test/test_ssl/test_nohttps.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web: image: web @@ -9,7 +13,29 @@ services: HTTPS_METHOD: nohttps sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./acme_root:/usr/share/nginx/html:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &acmeRoot ./acme_root:/usr/share/nginx/html:ro + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *acmeRoot + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *acmeRoot + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_ssl/test_noredirect.yml b/test/test_ssl/test_noredirect.yml index 19cdd3f..6f810ee 100644 --- a/test/test_ssl/test_noredirect.yml +++ b/test/test_ssl/test_noredirect.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web3: image: web @@ -9,8 +13,32 @@ services: HTTPS_METHOD: noredirect sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./certs:/etc/nginx/certs:ro - - ./acme_root:/usr/share/nginx/html:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &certs ./certs:/etc/nginx/certs:ro + - &acmeRoot ./acme_root:/usr/share/nginx/html:ro + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *certs + - *acmeRoot + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *certs + - *acmeRoot + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_ssl/test_virtual_path.yml b/test/test_ssl/test_virtual_path.yml index c94fc86..ce73464 100644 --- a/test/test_ssl/test_virtual_path.yml +++ b/test/test_ssl/test_virtual_path.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web1: image: web @@ -20,8 +24,32 @@ services: VIRTUAL_DEST: "/" sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./certs:/etc/nginx/certs:ro - - ./acme_root:/usr/share/nginx/html:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &certs ./certs:/etc/nginx/certs:ro + - &acmeRoot ./acme_root:/usr/share/nginx/html:ro + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *certs + - *acmeRoot + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *certs + - *acmeRoot + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_ssl/test_wildcard.yml b/test/test_ssl/test_wildcard.yml index 7bba93c..18ba725 100644 --- a/test/test_ssl/test_wildcard.yml +++ b/test/test_ssl/test_wildcard.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web1: image: web @@ -8,8 +12,32 @@ services: VIRTUAL_HOST: "*.nginx-proxy.tld" sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./certs:/etc/nginx/certs:ro - - ./acme_root:/usr/share/nginx/html:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &certs ./certs:/etc/nginx/certs:ro + - &acmeRoot ./acme_root:/usr/share/nginx/html:ro + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *certs + - *acmeRoot + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *certs + - *acmeRoot + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_trust-downstream-proxy/test_default.yml b/test/test_trust-downstream-proxy/test_default.yml index a6a7676..5276c5c 100644 --- a/test/test_trust-downstream-proxy/test_default.yml +++ b/test/test_trust-downstream-proxy/test_default.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web: image: web @@ -9,8 +13,32 @@ services: HTTPS_METHOD: noredirect sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro - - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &certificate ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro + - &privateKey ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *certificate + - *privateKey + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *certificate + - *privateKey + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_trust-downstream-proxy/test_disabled.yml b/test/test_trust-downstream-proxy/test_disabled.yml index 36ca154..8b032e3 100644 --- a/test/test_trust-downstream-proxy/test_disabled.yml +++ b/test/test_trust-downstream-proxy/test_disabled.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web: image: web @@ -9,10 +13,35 @@ services: HTTPS_METHOD: noredirect sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test - environment: - TRUST_DOWNSTREAM_PROXY: "false" volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro - - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &certificate ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro + - &privateKey ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro + environment: &nginxProxyEnv + TRUST_DOWNSTREAM_PROXY: "false" + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *certificate + - *privateKey + environment: *nginxProxyEnv + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *certificate + - *privateKey + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_trust-downstream-proxy/test_enabled.yml b/test/test_trust-downstream-proxy/test_enabled.yml index 800ff6d..bbc7bb7 100644 --- a/test/test_trust-downstream-proxy/test_enabled.yml +++ b/test/test_trust-downstream-proxy/test_enabled.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web: image: web @@ -9,10 +13,35 @@ services: HTTPS_METHOD: noredirect sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test - environment: - TRUST_DOWNSTREAM_PROXY: "true" volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro - - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &certificate ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro + - &privateKey ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro + environment: &nginxProxyEnv + TRUST_DOWNSTREAM_PROXY: "true" + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *certificate + - *privateKey + environment: *nginxProxyEnv + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *certificate + - *privateKey + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_upstream-name/test_predictable-name.yml b/test/test_upstream-name/test_predictable-name.yml index 3f8bd7a..72edec2 100644 --- a/test/test_upstream-name/test_predictable-name.yml +++ b/test/test_upstream-name/test_predictable-name.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web: image: web @@ -8,6 +12,26 @@ services: VIRTUAL_HOST: web.nginx-proxy.tld sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_upstream-name/test_sha1-name.yml b/test/test_upstream-name/test_sha1-name.yml index 5c3f048..80e2c84 100644 --- a/test/test_upstream-name/test_sha1-name.yml +++ b/test/test_upstream-name/test_sha1-name.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web: image: web @@ -8,8 +12,29 @@ services: VIRTUAL_HOST: web.nginx-proxy.tld sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - environment: + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + environment: &nginxProxyEnv SHA1_UPSTREAM_NAME: "true" + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + environment: *nginxProxyEnv + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_vhost-empty-string.yml b/test/test_vhost-empty-string.yml index dfbff1a..95e5ac0 100644 --- a/test/test_vhost-empty-string.yml +++ b/test/test_vhost-empty-string.yml @@ -1,8 +1,32 @@ +volumes: + nginx_conf: + + services: sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" web1: image: web diff --git a/test/test_vhost-in-multiple-networks.yml b/test/test_vhost-in-multiple-networks.yml index 16b82e4..96c66fc 100644 --- a/test/test_vhost-in-multiple-networks.yml +++ b/test/test_vhost-in-multiple-networks.yml @@ -3,13 +3,40 @@ networks: net2: net3: + +volumes: + nginx_conf: + + services: nginx-proxy: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - networks: - - net1 + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + networks: &nginxProxyNetworks + net1: + + + nginx-proxy-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + networks: *nginxProxyNetworks + + nginx-proxy-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" web: image: web @@ -19,6 +46,6 @@ services: WEB_PORTS: 81 VIRTUAL_HOST: web1.nginx-proxy.example networks: - - net1 - - net2 - - net3 + net1: + net2: + net3: diff --git a/test/test_virtual-path/test_custom_conf.yml b/test/test_virtual-path/test_custom_conf.yml index c8489d0..1435302 100644 --- a/test/test_virtual-path/test_custom_conf.yml +++ b/test/test_virtual-path/test_custom_conf.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: foo: image: web @@ -37,11 +41,38 @@ services: VIRTUAL_PATH: "~ ^/(web3|alt)/" sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test - environment: - DEFAULT_ROOT: 418 volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./foo.conf:/etc/nginx/vhost.d/foo.nginx-proxy.test:ro - - ./bar.conf:/etc/nginx/vhost.d/nginx-proxy.test_918d687a929083edd0c7224ee2293e0e7c062ab4_location:ro - - ./alternate.conf:/etc/nginx/vhost.d/nginx-proxy.test_7fb22b74bbdf907425dbbad18e4462565cada230_location:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &fooConf ./foo.conf:/etc/nginx/vhost.d/foo.nginx-proxy.test:ro + - &barConf ./bar.conf:/etc/nginx/vhost.d/nginx-proxy.test_918d687a929083edd0c7224ee2293e0e7c062ab4_location:ro + - &alternateConf ./alternate.conf:/etc/nginx/vhost.d/nginx-proxy.test_7fb22b74bbdf907425dbbad18e4462565cada230_location:ro + environment: &nginxProxyEnv + DEFAULT_ROOT: 418 + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *fooConf + - *barConf + - *alternateConf + environment: *nginxProxyEnv + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *fooConf + - *barConf + - *alternateConf + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_virtual-path/test_default-root-none.yml b/test/test_virtual-path/test_default-root-none.yml index b4de62f..872a549 100644 --- a/test/test_virtual-path/test_default-root-none.yml +++ b/test/test_virtual-path/test_default-root-none.yml @@ -1,11 +1,36 @@ +volumes: + nginx_conf: + + services: sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - environment: + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + environment: &nginxProxyEnv DEFAULT_ROOT: none + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + environment: *nginxProxyEnv + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" + web: image: web expose: diff --git a/test/test_virtual-path/test_forwarding.yml b/test/test_virtual-path/test_forwarding.yml index 72a70b7..eb1f45f 100644 --- a/test/test_virtual-path/test_forwarding.yml +++ b/test/test_virtual-path/test_forwarding.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web1: image: web @@ -10,9 +14,32 @@ services: VIRTUAL_DEST: "/" sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./certs:/etc/nginx/certs:ro - environment: - - DEFAULT_ROOT=301 http://$$host/web1$$request_uri + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &certs ./certs:/etc/nginx/certs:ro + environment: &nginxProxyEnv + DEFAULT_ROOT: "301 http://$$host/web1$$request_uri" + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *certs + environment: *nginxProxyEnv + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *certs + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_virtual-path/test_location_precedence.yml b/test/test_virtual-path/test_location_precedence.yml index 15385cd..9e5e6dd 100644 --- a/test/test_virtual-path/test_location_precedence.yml +++ b/test/test_virtual-path/test_location_precedence.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web1: image: web @@ -30,9 +34,35 @@ services: VIRTUAL_DEST: "/" sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - ./default.conf:/etc/nginx/vhost.d/default_location:ro - - ./host.conf:/etc/nginx/vhost.d/bar.nginx-proxy.test_location:ro - - ./path.conf:/etc/nginx/vhost.d/bar.nginx-proxy.test_99f2db0ed8aa95dbb5b87fca79c7eff2ff6bb8bd_location:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + - &defaultConf ./default.conf:/etc/nginx/vhost.d/default_location:ro + - &hostConf ./host.conf:/etc/nginx/vhost.d/bar.nginx-proxy.test_location:ro + - &pathConf ./path.conf:/etc/nginx/vhost.d/bar.nginx-proxy.test_99f2db0ed8aa95dbb5b87fca79c7eff2ff6bb8bd_location:ro + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + - *defaultConf + - *hostConf + - *pathConf + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + - *defaultConf + - *hostConf + - *pathConf + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_virtual-path/test_virtual_paths.yml b/test/test_virtual-path/test_virtual_paths.yml index 6e51b02..76ea185 100644 --- a/test/test_virtual-path/test_virtual_paths.yml +++ b/test/test_virtual-path/test_virtual_paths.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: foo: image: web @@ -37,6 +41,26 @@ services: VIRTUAL_PATH: "/" sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx" diff --git a/test/test_wildcard_host.yml b/test/test_wildcard_host.yml index 7d8da51..5819678 100644 --- a/test/test_wildcard_host.yml +++ b/test/test_wildcard_host.yml @@ -1,3 +1,7 @@ +volumes: + nginx_conf: + + services: web1: image: web @@ -32,6 +36,26 @@ services: VIRTUAL_HOST: ~^web4\..*\.nginx-proxy\.regexp$$ # we need to double the `$` because of docker compose variable interpolation sut: + profiles: + - singleContainer image: nginxproxy/nginx-proxy:test volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro + - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro + + sut-dockergen: + profiles: + - separateContainers + image: nginxproxy/nginx-proxy:test-dockergen + volumes: + - &confVolume nginx_conf:/etc/nginx/conf.d + - *dockerSocket + + sut-nginx: + profiles: + - separateContainers + container_name: nginx-proxy + image: nginx:alpine + volumes: + - *confVolume + labels: + - "com.github.nginx-proxy.nginx-proxy.nginx"