test_wildcard_host.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. volumes:
  2. nginx_conf:
  3. services:
  4. web1:
  5. image: web
  6. expose:
  7. - "81"
  8. environment:
  9. WEB_PORTS: "81"
  10. VIRTUAL_HOST: "*.nginx-proxy.test"
  11. web2:
  12. image: web
  13. expose:
  14. - "82"
  15. environment:
  16. WEB_PORTS: "82"
  17. VIRTUAL_HOST: "test.nginx-proxy.*"
  18. web3:
  19. image: web
  20. expose:
  21. - "83"
  22. environment:
  23. WEB_PORTS: "83"
  24. VIRTUAL_HOST: ~^web3\..*\.nginx-proxy\.regexp
  25. web4:
  26. image: web
  27. expose:
  28. - "84"
  29. environment:
  30. WEB_PORTS: "84"
  31. VIRTUAL_HOST: ~^web4\..*\.nginx-proxy\.regexp$$ # we need to double the `$` because of docker compose variable interpolation
  32. sut:
  33. profiles:
  34. - singleContainer
  35. image: nginxproxy/nginx-proxy:test
  36. volumes:
  37. - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro
  38. sut-dockergen:
  39. profiles:
  40. - separateContainers
  41. image: nginxproxy/nginx-proxy:test-dockergen
  42. volumes:
  43. - &confVolume nginx_conf:/etc/nginx/conf.d
  44. - *dockerSocket
  45. sut-nginx:
  46. profiles:
  47. - separateContainers
  48. container_name: nginx-proxy
  49. image: nginx:alpine
  50. volumes:
  51. - *confVolume
  52. labels:
  53. - "com.github.nginx-proxy.nginx-proxy.nginx"