docker-compose.dev.yml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. # WARNING: This is a DEVELOPMENT docker-compose file, it should not be used for production.
  2. services:
  3. fullstack:
  4. image: npm2dev:core
  5. container_name: npm2dev.core
  6. build:
  7. context: ./
  8. dockerfile: ./dev/Dockerfile
  9. ports:
  10. - 3080:80
  11. - 3081:81
  12. - 3443:443
  13. networks:
  14. nginx_proxy_manager:
  15. aliases:
  16. - website1.example.com
  17. - website2.example.com
  18. - website3.example.com
  19. environment:
  20. TZ: "${TZ:-Australia/Brisbane}"
  21. PUID: 1000
  22. PGID: 1000
  23. FORCE_COLOR: 1
  24. # specifically for dev:
  25. DEBUG: "true"
  26. DEVELOPMENT: "true"
  27. LE_STAGING: "true"
  28. # db:
  29. # DB_MYSQL_HOST: 'db'
  30. # DB_MYSQL_PORT: '3306'
  31. # DB_MYSQL_USER: 'npm'
  32. # DB_MYSQL_PASSWORD: 'npm'
  33. # DB_MYSQL_NAME: 'npm'
  34. # db-postgres:
  35. DB_POSTGRES_HOST: "pgdb.internal"
  36. DB_POSTGRES_PORT: "5432"
  37. DB_POSTGRES_USER: "npm"
  38. DB_POSTGRES_PASSWORD: "npmpass"
  39. DB_POSTGRES_NAME: "npm"
  40. # DB_SQLITE_FILE: "/data/database.sqlite"
  41. # DISABLE_IPV6: "true"
  42. # Required for DNS Certificate provisioning testing:
  43. LE_SERVER: "https://ca.internal/acme/acme/directory"
  44. REQUESTS_CA_BUNDLE: "/etc/ssl/certs/NginxProxyManager.crt"
  45. volumes:
  46. - npm_data:/data
  47. - le_data:/etc/letsencrypt
  48. - "./dev/resolv.conf:/etc/resolv.conf:ro"
  49. - ../backend:/app
  50. - ../frontend:/frontend
  51. - "/etc/localtime:/etc/localtime:ro"
  52. healthcheck:
  53. test: ["CMD", "/usr/bin/check-health"]
  54. interval: 10s
  55. timeout: 3s
  56. depends_on:
  57. - db
  58. - db-postgres
  59. - authentik
  60. - authentik-worker
  61. - authentik-ldap
  62. working_dir: /app
  63. db:
  64. image: jc21/mariadb-aria
  65. container_name: npm2dev.db
  66. ports:
  67. - 33306:3306
  68. networks:
  69. - nginx_proxy_manager
  70. environment:
  71. TZ: "${TZ:-Australia/Brisbane}"
  72. MYSQL_ROOT_PASSWORD: "npm"
  73. MYSQL_DATABASE: "npm"
  74. MYSQL_USER: "npm"
  75. MYSQL_PASSWORD: "npm"
  76. volumes:
  77. - db_data:/var/lib/mysql
  78. - "/etc/localtime:/etc/localtime:ro"
  79. db-postgres:
  80. image: postgres:17
  81. container_name: npm2dev.db-postgres
  82. environment:
  83. POSTGRES_USER: "npm"
  84. POSTGRES_PASSWORD: "npmpass"
  85. POSTGRES_DB: "npm"
  86. volumes:
  87. - psql_data:/var/lib/postgresql/data
  88. - ./ci/postgres:/docker-entrypoint-initdb.d
  89. networks:
  90. nginx_proxy_manager:
  91. aliases:
  92. - pgdb.internal
  93. stepca:
  94. image: jc21/testca
  95. container_name: npm2dev.stepca
  96. volumes:
  97. - "./dev/resolv.conf:/etc/resolv.conf:ro"
  98. - "/etc/localtime:/etc/localtime:ro"
  99. networks:
  100. nginx_proxy_manager:
  101. aliases:
  102. - ca.internal
  103. dnsrouter:
  104. image: jc21/dnsrouter
  105. container_name: npm2dev.dnsrouter
  106. volumes:
  107. - ./dev/dnsrouter-config.json.tmp:/dnsrouter-config.json:ro
  108. networks:
  109. - nginx_proxy_manager
  110. swagger:
  111. image: swaggerapi/swagger-ui:latest
  112. container_name: npm2dev.swagger
  113. ports:
  114. - 3082:80
  115. environment:
  116. URL: "http://npm:81/api/schema"
  117. PORT: "80"
  118. depends_on:
  119. - fullstack
  120. squid:
  121. image: ubuntu/squid
  122. container_name: npm2dev.squid
  123. volumes:
  124. - "./dev/squid.conf:/etc/squid/squid.conf:ro"
  125. - "./dev/resolv.conf:/etc/resolv.conf:ro"
  126. - "/etc/localtime:/etc/localtime:ro"
  127. networks:
  128. - nginx_proxy_manager
  129. ports:
  130. - 8128:3128
  131. pdns:
  132. image: pschiffe/pdns-mysql:4.8
  133. container_name: npm2dev.pdns
  134. volumes:
  135. - "/etc/localtime:/etc/localtime:ro"
  136. environment:
  137. PDNS_master: "yes"
  138. PDNS_api: "yes"
  139. PDNS_api_key: "npm"
  140. PDNS_webserver: "yes"
  141. PDNS_webserver_address: "0.0.0.0"
  142. PDNS_webserver_password: "npm"
  143. PDNS_webserver-allow-from: "127.0.0.0/8,192.0.0.0/8,10.0.0.0/8,172.0.0.0/8"
  144. PDNS_version_string: "anonymous"
  145. PDNS_default_ttl: 1500
  146. PDNS_allow_axfr_ips: "127.0.0.0/8,192.0.0.0/8,10.0.0.0/8,172.0.0.0/8"
  147. PDNS_gmysql_host: pdns-db
  148. PDNS_gmysql_port: 3306
  149. PDNS_gmysql_user: pdns
  150. PDNS_gmysql_password: pdns
  151. PDNS_gmysql_dbname: pdns
  152. depends_on:
  153. - pdns-db
  154. networks:
  155. nginx_proxy_manager:
  156. aliases:
  157. - ns1.pdns
  158. - ns2.pdns
  159. pdns-db:
  160. image: mariadb
  161. container_name: npm2dev.pdns-db
  162. environment:
  163. MYSQL_ROOT_PASSWORD: "pdns"
  164. MYSQL_DATABASE: "pdns"
  165. MYSQL_USER: "pdns"
  166. MYSQL_PASSWORD: "pdns"
  167. volumes:
  168. - "pdns_mysql:/var/lib/mysql"
  169. - "/etc/localtime:/etc/localtime:ro"
  170. - "./dev/pdns-db.sql:/docker-entrypoint-initdb.d/01_init.sql:ro"
  171. networks:
  172. - nginx_proxy_manager
  173. cypress:
  174. image: npm2dev:cypress
  175. container_name: npm2dev.cypress
  176. build:
  177. context: ../
  178. dockerfile: test/cypress/Dockerfile
  179. environment:
  180. HTTP_PROXY: "squid:3128"
  181. HTTPS_PROXY: "squid:3128"
  182. volumes:
  183. - "../test/results:/results"
  184. - "./dev/resolv.conf:/etc/resolv.conf:ro"
  185. - "/etc/localtime:/etc/localtime:ro"
  186. command: cypress run --browser chrome --config-file=cypress/config/ci.js
  187. networks:
  188. - nginx_proxy_manager
  189. authentik-redis:
  190. image: "redis:alpine"
  191. container_name: npm2dev.authentik-redis
  192. command: --save 60 1 --loglevel warning
  193. networks:
  194. - nginx_proxy_manager
  195. restart: unless-stopped
  196. healthcheck:
  197. test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
  198. start_period: 20s
  199. interval: 30s
  200. retries: 5
  201. timeout: 3s
  202. volumes:
  203. - redis_data:/data
  204. authentik:
  205. image: ghcr.io/goauthentik/server:2024.10.1
  206. container_name: npm2dev.authentik
  207. restart: unless-stopped
  208. command: server
  209. networks:
  210. - nginx_proxy_manager
  211. env_file:
  212. - ci.env
  213. ports:
  214. - 9000:9000
  215. depends_on:
  216. - authentik-redis
  217. - db-postgres
  218. authentik-worker:
  219. image: ghcr.io/goauthentik/server:2024.10.1
  220. container_name: npm2dev.authentik-worker
  221. restart: unless-stopped
  222. command: worker
  223. networks:
  224. - nginx_proxy_manager
  225. env_file:
  226. - ci.env
  227. depends_on:
  228. - authentik-redis
  229. - db-postgres
  230. authentik-ldap:
  231. image: ghcr.io/goauthentik/ldap:2024.10.1
  232. container_name: npm2dev.authentik-ldap
  233. networks:
  234. - nginx_proxy_manager
  235. environment:
  236. AUTHENTIK_HOST: "http://authentik:9000"
  237. AUTHENTIK_INSECURE: "true"
  238. AUTHENTIK_TOKEN: "wKYZuRcI0ETtb8vWzMCr04oNbhrQUUICy89hSpDln1OEKLjiNEuQ51044Vkp"
  239. restart: unless-stopped
  240. depends_on:
  241. - authentik
  242. volumes:
  243. npm_data:
  244. name: npm2dev_core_data
  245. le_data:
  246. name: npm2dev_le_data
  247. db_data:
  248. name: npm2dev_db_data
  249. pdns_mysql:
  250. name: npnpm2dev_pdns_mysql
  251. psql_data:
  252. name: npm2dev_psql_data
  253. redis_data:
  254. name: npm2dev_redis_data
  255. networks:
  256. nginx_proxy_manager:
  257. name: npm2dev_network