2
0

test_multiple-networks.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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: *nginxProxyNetworks
  28. nginx-proxy-nginx:
  29. profiles:
  30. - separateContainers
  31. container_name: nginx-proxy
  32. image: nginx:alpine
  33. volumes:
  34. - *confVolume
  35. labels:
  36. - "com.github.nginx-proxy.nginx-proxy.nginx"
  37. networks: *nginxProxyNetworks
  38. web1:
  39. image: web
  40. expose:
  41. - "81"
  42. environment:
  43. WEB_PORTS: 81
  44. VIRTUAL_HOST: web1.nginx-proxy.example
  45. networks:
  46. - net1
  47. web2:
  48. image: web
  49. expose:
  50. - "82"
  51. environment:
  52. WEB_PORTS: 82
  53. VIRTUAL_HOST: web2.nginx-proxy.example
  54. networks:
  55. - net2
  56. web3:
  57. image: web
  58. expose:
  59. - "83"
  60. environment:
  61. WEB_PORTS: 83
  62. VIRTUAL_HOST: web3.nginx-proxy.test
  63. networks:
  64. - net3a
  65. - net3b