test: separate containers (contd)

This commit is contained in:
Nicolas Duchon 2024-12-18 23:06:49 +01:00
parent b6f0556b70
commit d3154bb8bc
9 changed files with 262 additions and 24 deletions

View file

@ -1,5 +1,8 @@
volumes:
nginx_conf:
services: services:
# GIVEN a webserver with VIRTUAL_HOST set to web1.tld
web1: web1:
image: web image: web
expose: expose:
@ -8,10 +11,31 @@ services:
WEB_PORTS: 81 WEB_PORTS: 81
VIRTUAL_HOST: web1.tld VIRTUAL_HOST: web1.tld
# WHEN nginx-proxy runs with DEFAULT_HOST set to web1.tld
sut: sut:
profiles:
- singleContainer
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
environment: environment: &nginxProxyEnv
DEFAULT_HOST: web1.tld DEFAULT_HOST: web1.tld
sutdockergen:
profiles:
- separateContainers
image: nginxproxy/nginx-proxy:test-dockergen
environment:
<<: *nginxProxyEnv
volumes:
- &confVolume nginx_conf:/etc/nginx/conf.d
- *dockerSocket
sutnginx:
profiles:
- separateContainers
container_name: nginx-proxy
image: nginx:alpine
volumes:
- *confVolume
labels:
- "com.github.nginx-proxy.nginx-proxy.nginx"

View file

@ -1,12 +1,40 @@
volumes:
nginx_conf:
services: services:
sut: sut:
profiles:
- singleContainer
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
- ./withdefault.certs:/etc/nginx/certs:ro - &certs ./withdefault.certs:/etc/nginx/certs:ro
environment: environment: &nginxProxyEnv
ENABLE_HTTP_ON_MISSING_CERT: "false" ENABLE_HTTP_ON_MISSING_CERT: "false"
sutdockergen:
profiles:
- separateContainers
image: nginxproxy/nginx-proxy:test-dockergen
environment:
<<: *nginxProxyEnv
volumes:
- &confVolume nginx_conf:/etc/nginx/conf.d
- *dockerSocket
- *certs
sutnginx:
profiles:
- separateContainers
container_name: nginx-proxy
image: nginx:alpine
volumes:
- *confVolume
- *certs
labels:
- "com.github.nginx-proxy.nginx-proxy.nginx"
nohttp-missing-cert-disabled: nohttp-missing-cert-disabled:
image: web image: web
expose: expose:

View file

@ -1,5 +1,29 @@
volumes:
nginx_conf:
services: services:
nginxproxy: nginxproxy:
profiles:
- singleContainer
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
nginxproxy-dockergen:
profiles:
- separateContainers
image: nginxproxy/nginx-proxy:test-dockergen
volumes:
- &confVolume nginx_conf:/etc/nginx/conf.d
- *dockerSocket
nginxproxy-nginx:
profiles:
- separateContainers
container_name: nginx-proxy
image: nginx:alpine
volumes:
- *confVolume
labels:
- "com.github.nginx-proxy.nginx-proxy.nginx"

View file

@ -1,12 +1,40 @@
volumes:
nginx_conf:
services: services:
sut: sut:
profiles:
- singleContainer
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
- ./withdefault.certs:/etc/nginx/certs:ro - &certs ./withdefault.certs:/etc/nginx/certs:ro
environment: environment: &nginxProxyEnv
HTTPS_METHOD: nohttp HTTPS_METHOD: nohttp
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"
https-only: https-only:
image: web image: web
expose: expose:

View file

@ -1,12 +1,40 @@
volumes:
nginx_conf:
services: services:
sut: sut:
profiles:
- singleContainer
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
- ./withdefault.certs:/etc/nginx/certs:ro - &certs ./withdefault.certs:/etc/nginx/certs:ro
environment: environment: &nginxProxyEnv
HTTPS_METHOD: nohttp HTTPS_METHOD: nohttp
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"
https-only: https-only:
image: web image: web
expose: expose:

View file

@ -1,11 +1,37 @@
volumes:
nginx_conf:
services: services:
sut: sut:
profiles:
- singleContainer
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
environment: environment: &nginxProxyEnv
HTTPS_METHOD: redirect HTTPS_METHOD: redirect
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"
http-only: http-only:
image: web image: web
expose: expose:

View file

@ -1,11 +1,37 @@
volumes:
nginx_conf:
services: services:
sut: sut:
profiles:
- singleContainer
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
environment: environment: &nginxProxyEnv
HTTPS_METHOD: nohttps HTTPS_METHOD: nohttps
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"
http-only: http-only:
image: web image: web
expose: expose:

View file

@ -1,12 +1,40 @@
volumes:
nginx_conf:
services: services:
sut: sut:
profiles:
- singleContainer
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
- ./withdefault.certs:/etc/nginx/certs:ro - &certs ./withdefault.certs:/etc/nginx/certs:ro
environment: environment: &nginxProxyEnv
TRUST_DEFAULT_CERT: "false" TRUST_DEFAULT_CERT: "false"
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"
https-and-http: https-and-http:
image: web image: web
expose: expose:

View file

@ -1,9 +1,35 @@
volumes:
nginx_conf:
services: services:
sut: sut:
profiles:
- singleContainer
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
- ./withdefault.certs:/etc/nginx/certs:ro - &certs ./withdefault.certs:/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"
https-and-http: https-and-http:
image: web image: web