1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-02-24 01:38:15 +00:00

Merge pull request #2565 from nginx-proxy/chore/compose-version-obsolete

chore: docker compose version is obsolete
This commit is contained in:
Nicolas Duchon 2024-12-18 02:39:23 +01:00 committed by GitHub
commit 2bb0bbe5c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
90 changed files with 14 additions and 223 deletions

View File

@ -1,4 +1,5 @@
version: "2" volumes:
nginx_conf:
services: services:
nginx: nginx:
@ -7,17 +8,15 @@ services:
ports: ports:
- "80:80" - "80:80"
volumes: volumes:
- /etc/nginx/conf.d - nginx_conf:/etc/nginx/conf.d:ro
dockergen: dockergen:
image: nginxproxy/docker-gen image: nginxproxy/docker-gen
command: -notify-sighup nginx -watch /etc/docker-gen/templates/nginx.tmpl command: -notify-sighup nginx -watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
/etc/nginx/conf.d/default.conf
volumes_from:
- nginx
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - /var/run/docker.sock:/tmp/docker.sock:ro
- ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl
- nginx_conf:/etc/nginx/conf.d
whoami: whoami:
image: jwilder/whoami image: jwilder/whoami

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
nginx-proxy: nginx-proxy:
image: nginxproxy/nginx-proxy image: nginxproxy/nginx-proxy

View File

@ -1150,8 +1150,6 @@ docker run -e VIRTUAL_HOST=foo.bar.com ...
## Docker Compose ## Docker Compose
```yaml ```yaml
version: "2"
services: services:
nginx-proxy: nginx-proxy:
image: nginxproxy/nginx-proxy image: nginxproxy/nginx-proxy

View File

@ -1,5 +1,3 @@
version: "2"
networks: networks:
netA: netA:
netB: netB:

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
nginx-proxy: nginx-proxy:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
nginx-proxy: nginx-proxy:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
nginx-proxy: nginx-proxy:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
nginx-proxy: nginx-proxy:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
nginx-proxy: nginx-proxy:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
# GIVEN a webserver with VIRTUAL_HOST set to web1.tld # GIVEN a webserver with VIRTUAL_HOST set to web1.tld
web1: web1:

View File

@ -1,11 +1,9 @@
version: "3"
services: services:
nginx: nginx:
image: nginx image: nginx
container_name: nginx container_name: nginx
volumes: volumes:
- nginx_conf:/etc/nginx/conf.d - nginx_conf:/etc/nginx/conf.d:ro
dockergen: dockergen:
image: nginxproxy/docker-gen image: nginxproxy/docker-gen
@ -25,4 +23,4 @@ services:
VIRTUAL_HOST: whoami.nginx.container.docker VIRTUAL_HOST: whoami.nginx.container.docker
volumes: volumes:
nginx_conf: {} nginx_conf:

View File

@ -1,10 +0,0 @@
def test_unknown_virtual_host_is_503(docker_compose, nginxproxy):
r = nginxproxy.get("http://unknown.nginx.container.docker/")
assert r.status_code == 503
def test_forwards_to_whoami(docker_compose, nginxproxy):
r = nginxproxy.get("http://whoami.nginx.container.docker/")
assert r.status_code == 200
whoami_container = docker_compose.containers.get("whoami")
assert r.text == f"I'm {whoami_container.id[:12]}\n"

View File

@ -1,26 +0,0 @@
version: "2"
services:
nginx:
image: nginx
container_name: nginx
volumes:
- /etc/nginx/conf.d
dockergen:
image: nginxproxy/docker-gen
command: -notify-sighup nginx -watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
volumes_from:
- nginx
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ../../nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl
web:
image: web
container_name: whoami
expose:
- "80"
environment:
WEB_PORTS: 80
VIRTUAL_HOST: whoami.nginx.container.docker

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
nginxproxy: nginxproxy:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
networks: networks:
net1: net1:
internal: true internal: true

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
host-network-1: host-network-1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
regex: regex:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
http2-global-disabled: http2-global-disabled:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
http3-global-disabled: http3-global-disabled:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
http3-global-enabled: http3-global-enabled:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
http3-vhost-enabled: http3-vhost-enabled:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
networks: networks:
net1: net1:
enable_ipv6: true enable_ipv6: true

View File

@ -1,5 +1,3 @@
version: "2"
networks: networks:
ipv4net: ipv4net:
ipam: ipam:

View File

@ -1,5 +1,3 @@
version: "2"
networks: networks:
ipv4net: ipv4net:
ipam: ipam:

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
keepalive-disabled: keepalive-disabled:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
loadbalance-hash: loadbalance-hash:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,10 +1,8 @@
version: "2"
networks: networks:
net1: {} net1:
net2: {} net2:
net3a: {} net3a:
net3b: {} net3b:
services: services:
nginx-proxy: nginx-proxy:

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
skipvirtualhost: skipvirtualhost:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
skipvirtualhost: skipvirtualhost:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
invalidsyntax: invalidsyntax:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
merged-singleport: merged-singleport:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
networks: networks:
net1: net1:
enable_ipv6: true enable_ipv6: true

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
networks: networks:
net1: net1:
enable_ipv6: true enable_ipv6: true

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web5: web5:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web2: web2:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web3: web3:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web: web:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,9 +1,7 @@
version: "2"
networks: networks:
net1: {} net1:
net2: {} net2:
net3: {} net3:
services: services:
nginx-proxy: nginx-proxy:

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
foo: foo:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
sut: sut:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
foo: foo:
image: web image: web

View File

@ -1,5 +1,3 @@
version: "2"
services: services:
web1: web1:
image: web image: web