test_host-network-mode.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. networks:
  2. net1:
  3. internal: true
  4. net2:
  5. volumes:
  6. nginx_conf:
  7. services:
  8. bridge-network:
  9. image: web
  10. environment:
  11. WEB_PORTS: "80"
  12. VIRTUAL_HOST: "bridge-network.nginx-proxy.tld"
  13. networks:
  14. - net2
  15. host-network:
  16. image: web
  17. environment:
  18. WEB_PORTS: "8080"
  19. VIRTUAL_HOST: "host-network.nginx-proxy.tld"
  20. VIRTUAL_PORT: "8080"
  21. network_mode: host
  22. sut:
  23. profiles:
  24. - singleContainer
  25. image: nginxproxy/nginx-proxy:test
  26. volumes:
  27. - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
  28. networks:
  29. - net1
  30. - net2
  31. sut-dockergen:
  32. profiles:
  33. - separateContainers
  34. image: nginxproxy/nginx-proxy:test-dockergen
  35. volumes:
  36. - &confVolume nginx_conf:/etc/nginx/conf.d
  37. - *dockerSocket
  38. networks:
  39. - net1
  40. - net2
  41. sut-nginx:
  42. profiles:
  43. - separateContainers
  44. container_name: nginx-proxy
  45. image: nginx:alpine
  46. volumes:
  47. - *confVolume
  48. networks:
  49. - net1
  50. - net2
  51. labels:
  52. - "com.github.nginx-proxy.nginx-proxy.nginx"