docker-compose.ci.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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-81/tcp'
  28. - '443/tcp'
  29. - '1500-1503/tcp'
  30. networks:
  31. fulltest:
  32. aliases:
  33. - website1.example.com
  34. - website2.example.com
  35. - website3.example.com
  36. stepca:
  37. image: jc21/testca
  38. volumes:
  39. - './dev/resolv.conf:/etc/resolv.conf:ro'
  40. - '/etc/localtime:/etc/localtime:ro'
  41. networks:
  42. fulltest:
  43. aliases:
  44. - ca.internal
  45. pdns:
  46. image: pschiffe/pdns-mysql:4.8
  47. volumes:
  48. - '/etc/localtime:/etc/localtime:ro'
  49. environment:
  50. PDNS_master: 'yes'
  51. PDNS_api: 'yes'
  52. PDNS_api_key: 'npm'
  53. PDNS_webserver: 'yes'
  54. PDNS_webserver_address: '0.0.0.0'
  55. PDNS_webserver_password: 'npm'
  56. PDNS_webserver-allow-from: '127.0.0.0/8,192.0.0.0/8,10.0.0.0/8,172.0.0.0/8'
  57. PDNS_version_string: 'anonymous'
  58. PDNS_default_ttl: 1500
  59. PDNS_allow_axfr_ips: '127.0.0.0/8,192.0.0.0/8,10.0.0.0/8,172.0.0.0/8'
  60. PDNS_gmysql_host: pdns-db
  61. PDNS_gmysql_port: 3306
  62. PDNS_gmysql_user: pdns
  63. PDNS_gmysql_password: pdns
  64. PDNS_gmysql_dbname: pdns
  65. depends_on:
  66. - pdns-db
  67. networks:
  68. fulltest:
  69. aliases:
  70. - ns1.pdns
  71. - ns2.pdns
  72. pdns-db:
  73. image: mariadb
  74. environment:
  75. MYSQL_ROOT_PASSWORD: 'pdns'
  76. MYSQL_DATABASE: 'pdns'
  77. MYSQL_USER: 'pdns'
  78. MYSQL_PASSWORD: 'pdns'
  79. volumes:
  80. - 'pdns_mysql_vol:/var/lib/mysql'
  81. - '/etc/localtime:/etc/localtime:ro'
  82. - './dev/pdns-db.sql:/docker-entrypoint-initdb.d/01_init.sql:ro'
  83. networks:
  84. - fulltest
  85. dnsrouter:
  86. image: jc21/dnsrouter
  87. volumes:
  88. - ./dev/dnsrouter-config.json.tmp:/dnsrouter-config.json:ro
  89. networks:
  90. - fulltest
  91. cypress:
  92. image: "${IMAGE}-cypress:ci-${BUILD_NUMBER}"
  93. build:
  94. context: ../
  95. dockerfile: test/cypress/Dockerfile
  96. environment:
  97. HTTP_PROXY: 'squid:3128'
  98. HTTPS_PROXY: 'squid:3128'
  99. volumes:
  100. - 'cypress_logs:/test/results'
  101. - './dev/resolv.conf:/etc/resolv.conf:ro'
  102. - '/etc/localtime:/etc/localtime:ro'
  103. command: cypress run --browser chrome --config-file=cypress/config/ci.js
  104. networks:
  105. - fulltest
  106. squid:
  107. image: ubuntu/squid
  108. volumes:
  109. - './dev/squid.conf:/etc/squid/squid.conf:ro'
  110. - './dev/resolv.conf:/etc/resolv.conf:ro'
  111. - '/etc/localtime:/etc/localtime:ro'
  112. networks:
  113. - fulltest
  114. volumes:
  115. cypress_logs:
  116. npm_data_ci:
  117. npm_le_ci:
  118. pdns_mysql_vol:
  119. networks:
  120. fulltest:
  121. name: "npm-${BRANCH_LOWER}-ci-${BUILD_NUMBER}"