docker-compose.ci.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. # WARNING: This is a CI docker-compose file used for building
  2. # and testing of the entire app, it should not be used for production.
  3. # This is a base compose file, it should be extended with a
  4. # docker-compose.ci.*.yml file
  5. services:
  6. fullstack:
  7. image: "${IMAGE}:${BRANCH_LOWER}-ci-${BUILD_NUMBER}"
  8. environment:
  9. TZ: "${TZ:-Australia/Brisbane}"
  10. DEBUG: "true"
  11. CI: "true"
  12. FORCE_COLOR: 1
  13. # Required for DNS Certificate provisioning in CI
  14. LE_SERVER: "https://ca.internal/acme/acme/directory"
  15. REQUESTS_CA_BUNDLE: "/etc/ssl/certs/NginxProxyManager.crt"
  16. volumes:
  17. - "npm_data_ci:/data"
  18. - "npm_le_ci:/etc/letsencrypt"
  19. - "./dev/letsencrypt.ini:/etc/letsencrypt.ini:ro"
  20. - "./dev/resolv.conf:/etc/resolv.conf:ro"
  21. - "/etc/localtime:/etc/localtime:ro"
  22. healthcheck:
  23. test: ["CMD", "/usr/bin/check-health"]
  24. interval: 10s
  25. timeout: 3s
  26. expose:
  27. - "80/tcp"
  28. - "81/tcp"
  29. - "443/tcp"
  30. - "1500/tcp"
  31. - "1501/tcp"
  32. - "1502/tcp"
  33. - "1503/tcp"
  34. networks:
  35. fulltest:
  36. aliases:
  37. - website1.example.com
  38. - website2.example.com
  39. - website3.example.com
  40. stepca:
  41. image: jc21/testca
  42. volumes:
  43. - "./dev/resolv.conf:/etc/resolv.conf:ro"
  44. - "/etc/localtime:/etc/localtime:ro"
  45. networks:
  46. fulltest:
  47. aliases:
  48. - ca.internal
  49. pdns:
  50. image: pschiffe/pdns-mysql:4.8
  51. volumes:
  52. - "/etc/localtime:/etc/localtime:ro"
  53. environment:
  54. PDNS_master: "yes"
  55. PDNS_api: "yes"
  56. PDNS_api_key: "npm"
  57. PDNS_webserver: "yes"
  58. PDNS_webserver_address: "0.0.0.0"
  59. PDNS_webserver_password: "npm"
  60. PDNS_webserver-allow-from: "127.0.0.0/8,192.0.0.0/8,10.0.0.0/8,172.0.0.0/8"
  61. PDNS_version_string: "anonymous"
  62. PDNS_default_ttl: 1500
  63. PDNS_allow_axfr_ips: "127.0.0.0/8,192.0.0.0/8,10.0.0.0/8,172.0.0.0/8"
  64. PDNS_gmysql_host: pdns-db
  65. PDNS_gmysql_port: 3306
  66. PDNS_gmysql_user: pdns
  67. PDNS_gmysql_password: pdns
  68. PDNS_gmysql_dbname: pdns
  69. depends_on:
  70. - pdns-db
  71. networks:
  72. fulltest:
  73. aliases:
  74. - ns1.pdns
  75. - ns2.pdns
  76. pdns-db:
  77. image: mariadb
  78. environment:
  79. MYSQL_ROOT_PASSWORD: "pdns"
  80. MYSQL_DATABASE: "pdns"
  81. MYSQL_USER: "pdns"
  82. MYSQL_PASSWORD: "pdns"
  83. volumes:
  84. - "pdns_mysql_vol:/var/lib/mysql"
  85. - "/etc/localtime:/etc/localtime:ro"
  86. - "./dev/pdns-db.sql:/docker-entrypoint-initdb.d/01_init.sql:ro"
  87. networks:
  88. - fulltest
  89. dnsrouter:
  90. image: jc21/dnsrouter
  91. volumes:
  92. - ./dev/dnsrouter-config.json.tmp:/dnsrouter-config.json:ro
  93. networks:
  94. - fulltest
  95. cypress:
  96. image: "${IMAGE}-cypress:ci-${BUILD_NUMBER}"
  97. build:
  98. context: ../
  99. dockerfile: test/cypress/Dockerfile
  100. environment:
  101. HTTP_PROXY: "squid:3128"
  102. HTTPS_PROXY: "squid:3128"
  103. volumes:
  104. - "cypress_logs:/test/results"
  105. - "./dev/resolv.conf:/etc/resolv.conf:ro"
  106. - "/etc/localtime:/etc/localtime:ro"
  107. command: cypress run --browser chrome --config-file=cypress/config/ci.js
  108. networks:
  109. - fulltest
  110. squid:
  111. image: ubuntu/squid
  112. volumes:
  113. - "./dev/squid.conf:/etc/squid/squid.conf:ro"
  114. - "./dev/resolv.conf:/etc/resolv.conf:ro"
  115. - "/etc/localtime:/etc/localtime:ro"
  116. networks:
  117. - fulltest
  118. volumes:
  119. cypress_logs:
  120. npm_data_ci:
  121. npm_le_ci:
  122. pdns_mysql_vol:
  123. networks:
  124. fulltest:
  125. name: "npm-${BRANCH_LOWER}-ci-${BUILD_NUMBER}"