test_multiple-networks.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. networks:
  2. net1:
  3. net2:
  4. net3a:
  5. net3b:
  6. volumes:
  7. nginx_conf:
  8. services:
  9. nginx-proxy:
  10. profiles:
  11. - singleContainer
  12. image: nginxproxy/nginx-proxy:test
  13. volumes:
  14. - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
  15. networks: &nginxProxyNetworks
  16. net1:
  17. net2:
  18. net3a:
  19. net3b:
  20. nginx-proxy-dockergen:
  21. profiles:
  22. - separateContainers
  23. image: nginxproxy/nginx-proxy:test-dockergen
  24. volumes:
  25. - &confVolume nginx_conf:/etc/nginx/conf.d
  26. - *dockerSocket
  27. networks:
  28. <<: *nginxProxyNetworks
  29. nginx-proxy-nginx:
  30. profiles:
  31. - separateContainers
  32. container_name: nginx-proxy
  33. image: nginx:alpine
  34. volumes:
  35. - *confVolume
  36. labels:
  37. - "com.github.nginx-proxy.nginx-proxy.nginx"
  38. networks:
  39. <<: *nginxProxyNetworks
  40. web1:
  41. image: web
  42. expose:
  43. - "81"
  44. environment:
  45. WEB_PORTS: 81
  46. VIRTUAL_HOST: web1.nginx-proxy.example
  47. networks:
  48. - net1
  49. web2:
  50. image: web
  51. expose:
  52. - "82"
  53. environment:
  54. WEB_PORTS: 82
  55. VIRTUAL_HOST: web2.nginx-proxy.example
  56. networks:
  57. - net2
  58. web3:
  59. image: web
  60. expose:
  61. - "83"
  62. environment:
  63. WEB_PORTS: 83
  64. VIRTUAL_HOST: web3.nginx-proxy.test
  65. networks:
  66. - net3a
  67. - net3b