docker-compose.yaml 1.1 KB

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