docker-compose.dev.yml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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: "db-postgres"
  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. networks:
  83. - nginx_proxy_manager
  84. environment:
  85. POSTGRES_USER: "npm"
  86. POSTGRES_PASSWORD: "npmpass"
  87. POSTGRES_DB: "npm"
  88. volumes:
  89. - psql_data:/var/lib/postgresql/data
  90. - ./ci/postgres:/docker-entrypoint-initdb.d
  91. stepca:
  92. image: jc21/testca
  93. container_name: npm2dev.stepca
  94. volumes:
  95. - "./dev/resolv.conf:/etc/resolv.conf:ro"
  96. - "/etc/localtime:/etc/localtime:ro"
  97. networks:
  98. nginx_proxy_manager:
  99. aliases:
  100. - ca.internal
  101. dnsrouter:
  102. image: jc21/dnsrouter
  103. container_name: npm2dev.dnsrouter
  104. volumes:
  105. - ./dev/dnsrouter-config.json.tmp:/dnsrouter-config.json:ro
  106. networks:
  107. - nginx_proxy_manager
  108. swagger:
  109. image: swaggerapi/swagger-ui:latest
  110. container_name: npm2dev.swagger
  111. ports:
  112. - 3082:80
  113. environment:
  114. URL: "http://npm:81/api/schema"
  115. PORT: "80"
  116. depends_on:
  117. - fullstack
  118. squid:
  119. image: ubuntu/squid
  120. container_name: npm2dev.squid
  121. volumes:
  122. - "./dev/squid.conf:/etc/squid/squid.conf:ro"
  123. - "./dev/resolv.conf:/etc/resolv.conf:ro"
  124. - "/etc/localtime:/etc/localtime:ro"
  125. networks:
  126. - nginx_proxy_manager
  127. ports:
  128. - 8128:3128
  129. pdns:
  130. image: pschiffe/pdns-mysql:4.8
  131. container_name: npm2dev.pdns
  132. volumes:
  133. - "/etc/localtime:/etc/localtime:ro"
  134. environment:
  135. PDNS_master: "yes"
  136. PDNS_api: "yes"
  137. PDNS_api_key: "npm"
  138. PDNS_webserver: "yes"
  139. PDNS_webserver_address: "0.0.0.0"
  140. PDNS_webserver_password: "npm"
  141. PDNS_webserver-allow-from: "127.0.0.0/8,192.0.0.0/8,10.0.0.0/8,172.0.0.0/8"
  142. PDNS_version_string: "anonymous"
  143. PDNS_default_ttl: 1500
  144. PDNS_allow_axfr_ips: "127.0.0.0/8,192.0.0.0/8,10.0.0.0/8,172.0.0.0/8"
  145. PDNS_gmysql_host: pdns-db
  146. PDNS_gmysql_port: 3306
  147. PDNS_gmysql_user: pdns
  148. PDNS_gmysql_password: pdns
  149. PDNS_gmysql_dbname: pdns
  150. depends_on:
  151. - pdns-db
  152. networks:
  153. nginx_proxy_manager:
  154. aliases:
  155. - ns1.pdns
  156. - ns2.pdns
  157. pdns-db:
  158. image: mariadb
  159. container_name: npm2dev.pdns-db
  160. environment:
  161. MYSQL_ROOT_PASSWORD: "pdns"
  162. MYSQL_DATABASE: "pdns"
  163. MYSQL_USER: "pdns"
  164. MYSQL_PASSWORD: "pdns"
  165. volumes:
  166. - "pdns_mysql:/var/lib/mysql"
  167. - "/etc/localtime:/etc/localtime:ro"
  168. - "./dev/pdns-db.sql:/docker-entrypoint-initdb.d/01_init.sql:ro"
  169. networks:
  170. - nginx_proxy_manager
  171. cypress:
  172. image: npm2dev:cypress
  173. container_name: npm2dev.cypress
  174. build:
  175. context: ../
  176. dockerfile: test/cypress/Dockerfile
  177. environment:
  178. HTTP_PROXY: "squid:3128"
  179. HTTPS_PROXY: "squid:3128"
  180. volumes:
  181. - "../test/results:/results"
  182. - "./dev/resolv.conf:/etc/resolv.conf:ro"
  183. - "/etc/localtime:/etc/localtime:ro"
  184. command: cypress run --browser chrome --config-file=cypress/config/ci.js
  185. networks:
  186. - nginx_proxy_manager
  187. authentik-redis:
  188. image: "redis:alpine"
  189. container_name: npm2dev.authentik-redis
  190. command: --save 60 1 --loglevel warning
  191. networks:
  192. - nginx_proxy_manager
  193. restart: unless-stopped
  194. healthcheck:
  195. test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
  196. start_period: 20s
  197. interval: 30s
  198. retries: 5
  199. timeout: 3s
  200. volumes:
  201. - redis_data:/data
  202. authentik:
  203. image: ghcr.io/goauthentik/server:2024.10.1
  204. container_name: npm2dev.authentik
  205. restart: unless-stopped
  206. command: server
  207. networks:
  208. - nginx_proxy_manager
  209. env_file:
  210. - ci.env
  211. ports:
  212. - 9000:9000
  213. depends_on:
  214. - authentik-redis
  215. - db-postgres
  216. authentik-worker:
  217. image: ghcr.io/goauthentik/server:2024.10.1
  218. container_name: npm2dev.authentik-worker
  219. restart: unless-stopped
  220. command: worker
  221. networks:
  222. - nginx_proxy_manager
  223. env_file:
  224. - ci.env
  225. depends_on:
  226. - authentik-redis
  227. - db-postgres
  228. authentik-ldap:
  229. image: ghcr.io/goauthentik/ldap:2024.10.1
  230. container_name: npm2dev.authentik-ldap
  231. networks:
  232. - nginx_proxy_manager
  233. environment:
  234. AUTHENTIK_HOST: "http://authentik:9000"
  235. AUTHENTIK_INSECURE: "true"
  236. AUTHENTIK_TOKEN: "wKYZuRcI0ETtb8vWzMCr04oNbhrQUUICy89hSpDln1OEKLjiNEuQ51044Vkp"
  237. restart: unless-stopped
  238. depends_on:
  239. - authentik
  240. volumes:
  241. npm_data:
  242. name: npm2dev_core_data
  243. le_data:
  244. name: npm2dev_le_data
  245. db_data:
  246. name: npm2dev_db_data
  247. pdns_mysql:
  248. name: npnpm2dev_pdns_mysql
  249. psql_data:
  250. name: npm2dev_psql_data
  251. redis_data:
  252. name: npm2dev_redis_data
  253. networks:
  254. nginx_proxy_manager:
  255. name: npm2dev_network