docker-compose.yaml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # docker-compose.yml
  2. version: "3.7"
  3. secrets:
  4. # paths assume the .secrets folder is sibling depth to folder where docker-compose resides
  5. DB_ROOT_PWD:
  6. file: ../.secrets/db_root_pwd.txt
  7. MYSQL_PWD:
  8. file: ../.secrets/mysql_pwd.txt
  9. # networks:
  10. # npm-bridge: # arbitrary name
  11. # driver: bridge
  12. services:
  13. mariadb:
  14. image: ahgraber/mariadb-aria:test
  15. container_name: mariadb
  16. secrets:
  17. - DB_ROOT_PWD
  18. - MYSQL_PWD
  19. # networks:
  20. # - npm-bridge
  21. # ports:
  22. # - 3306:3306
  23. environment:
  24. # MYSQL_ROOT_PASSWORD: "npm"
  25. MYSQL_ROOT_PASSWORD__FILE: /run/secrets/DB_ROOT_PWD
  26. MYSQL_DATABASE: "npm"
  27. MYSQL_USER: "npm"
  28. # MYSQL_PASSWORD: "npm"
  29. MYSQL_PASSWORD__FILE: /run/secrets/MYSQL_PWD
  30. volumes:
  31. - ./data/mysql:/var/lib/mysql
  32. # - npm-mount:/var/lib/mysql
  33. # restart: unless-stopped
  34. npm:
  35. build:
  36. context: .
  37. dockerfile: ./Dockerfile
  38. # args:
  39. # TARGETPLATFORM: arm64v8
  40. image: nginx-proxy-manager:test # provide a name and tag for the image
  41. container_name: npm
  42. secrets:
  43. - MYSQL_PWD
  44. # networks:
  45. # - npm-bridge
  46. ports:
  47. - 8080:80
  48. - 8443:443
  49. - 8888:81
  50. environment:
  51. DISABLE_IPV6: 'true'
  52. DB_MYSQL_HOST: "mariadb"
  53. DB_MYSQL_PORT: 3306
  54. DB_MYSQL_NAME: "npm"
  55. DB_MYSQL_USER: "npm"
  56. # DB_MYSQL_PASSWORD: "npm"
  57. DB_MYSQL_PASSWORD__FILE: /run/secrets/MYSQL_PWD
  58. # DB_MYSQL_PASSWORD: "sqlL3tm3in"
  59. volumes:
  60. - ./data/npm:/data
  61. - ./data/letsencrypt:/etc/letsencrypt
  62. # - npm-mount:/data
  63. # - letsencrypt-mount:/etc/letsencrypt
  64. depends_on:
  65. - mariadb
  66. # restart: unless-stopped
  67. # ## https://stackoverflow.com/questions/45282608/how-to-directly-mount-nfs-share-volume-in-container-using-docker-compose-v3
  68. # volumes:
  69. # npm-mount:
  70. # driver: local
  71. # driver_opts:
  72. # type: nfs
  73. # o: nfsvers=4,addr=10.2.1.1,rw,retry=1,soft,nolock
  74. # device: ":/npm"
  75. # letsencrypt-mount:
  76. # driver: local
  77. # driver_opts:
  78. # type: nfs
  79. # o: nfsvers=4,addr=10.2.1.1,rw,retry=1,soft,nolock
  80. # device: ":/letsencrypt"