docker-compose.ci.yml 3.4 KB

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