compose.yaml 942 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. services:
  2. backend:
  3. build: backend
  4. secrets:
  5. - db-password
  6. depends_on:
  7. db:
  8. condition: service_healthy
  9. db:
  10. # We use a mariadb image which supports both amd64 & arm64 architecture
  11. image: mariadb:10.6.4-focal
  12. # If you really want to use MySQL, uncomment the following line
  13. #image: mysql:8.0.27
  14. command: '--default-authentication-plugin=mysql_native_password'
  15. restart: always
  16. healthcheck:
  17. test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
  18. interval: 3s
  19. retries: 5
  20. start_period: 30s
  21. secrets:
  22. - db-password
  23. volumes:
  24. - db-data:/var/lib/mysql
  25. environment:
  26. - MYSQL_DATABASE=example
  27. - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password
  28. expose:
  29. - 3306
  30. proxy:
  31. build: proxy
  32. ports:
  33. - 80:80
  34. depends_on:
  35. - backend
  36. volumes:
  37. db-data:
  38. secrets:
  39. db-password:
  40. file: db/password.txt