4
0

compose.yaml 1.0 KB

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