4
0

compose.yaml 624 B

12345678910111213141516171819202122232425262728
  1. services:
  2. backend:
  3. build: backend
  4. ports:
  5. - 8080:8080
  6. secrets:
  7. - db-password
  8. db:
  9. # We use a mariadb image which supports both amd64 & arm64 architecture
  10. image: mariadb:10.6.4-focal
  11. # If you really want to use MySQL, uncomment the following line
  12. #image: mysql:8.0.27
  13. restart: always
  14. secrets:
  15. - db-password
  16. volumes:
  17. - db-data:/var/lib/mysql
  18. environment:
  19. - MYSQL_DATABASE=example
  20. - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password
  21. expose:
  22. - 3306
  23. - 33060
  24. volumes:
  25. db-data:
  26. secrets:
  27. db-password:
  28. file: db/password.txt