4
0

compose.yaml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. services:
  2. backend:
  3. build:
  4. args:
  5. - NODE_ENV=development
  6. context: backend
  7. target: development
  8. command: npm run start-watch
  9. environment:
  10. - DATABASE_DB=example
  11. - DATABASE_USER=root
  12. - DATABASE_PASSWORD=/run/secrets/db-password
  13. - DATABASE_HOST=db
  14. - NODE_ENV=development
  15. ports:
  16. - 80:80
  17. - 9229:9229
  18. - 9230:9230
  19. secrets:
  20. - db-password
  21. volumes:
  22. - ./backend/src:/code/src:ro
  23. - ./backend/package.json:/code/package.json
  24. - ./backend/package-lock.json:/code/package-lock.json
  25. - back-notused:/opt/app/node_modules
  26. networks:
  27. - public
  28. - private
  29. depends_on:
  30. - db
  31. db:
  32. # We use a mariadb image which supports both amd64 & arm64 architecture
  33. image: mariadb:11.8
  34. # If you really want to use MySQL, uncomment the following line
  35. #image: mysql:8.0.27
  36. command: '--default-authentication-plugin=mysql_native_password'
  37. restart: always
  38. secrets:
  39. - db-password
  40. volumes:
  41. - db-data:/var/lib/mysql
  42. networks:
  43. - private
  44. environment:
  45. - MARIADB_AUTO_UPGRADE=1
  46. - MYSQL_DATABASE=example
  47. - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password
  48. frontend:
  49. build:
  50. context: frontend
  51. target: development
  52. ports:
  53. - 3000:3000
  54. volumes:
  55. - ./frontend/src:/code/src
  56. - /code/node_modules
  57. networks:
  58. - public
  59. depends_on:
  60. - backend
  61. networks:
  62. public:
  63. private:
  64. volumes:
  65. back-notused:
  66. db-data:
  67. secrets:
  68. db-password:
  69. file: db/password.txt