4
0

compose.yaml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. services:
  2. db:
  3. # We use a mariadb image which supports both amd64 & arm64 architecture
  4. image: mariadb:10-focal
  5. # If you really want to use MySQL, uncomment the following line
  6. #image: mysql:8
  7. command: '--default-authentication-plugin=mysql_native_password'
  8. restart: always
  9. healthcheck:
  10. test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 --password="$$(cat /run/secrets/db-password)" --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:
  28. context: backend
  29. target: builder
  30. restart: always
  31. secrets:
  32. - db-password
  33. ports:
  34. - 8000:8000
  35. networks:
  36. - backnet
  37. - frontnet
  38. depends_on:
  39. db:
  40. condition: service_healthy
  41. proxy:
  42. build: proxy
  43. restart: always
  44. ports:
  45. - 80:80
  46. depends_on:
  47. - backend
  48. networks:
  49. - frontnet
  50. volumes:
  51. db-data:
  52. secrets:
  53. db-password:
  54. file: db/password.txt
  55. networks:
  56. backnet:
  57. frontnet: