4
0

docker-compose.yaml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. services:
  2. backend:
  3. build:
  4. args:
  5. - NODE_ENV=development
  6. context: backend
  7. target: dev-envs
  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. - /var/run/docker.sock:/var/run/docker.sock
  23. networks:
  24. - public
  25. - private
  26. depends_on:
  27. - db
  28. db:
  29. # We use a mariadb image which supports both amd64 & arm64 architecture
  30. image: mariadb:10.6.4-focal
  31. # If you really want to use MySQL, uncomment the following line
  32. #image: mysql:8.0.27
  33. command: '--default-authentication-plugin=mysql_native_password'
  34. restart: always
  35. secrets:
  36. - db-password
  37. volumes:
  38. - db-data:/var/lib/mysql
  39. networks:
  40. - private
  41. environment:
  42. - MYSQL_DATABASE=example
  43. - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password
  44. frontend:
  45. build:
  46. context: frontend
  47. target: dev-envs
  48. ports:
  49. - 3000:3000
  50. volumes:
  51. - /var/run/docker.sock:/var/run/docker.sock
  52. networks:
  53. - public
  54. depends_on:
  55. - backend
  56. networks:
  57. public:
  58. private:
  59. volumes:
  60. back-notused:
  61. db-data:
  62. secrets:
  63. db-password:
  64. file: db/password.txt