compose.yaml 1023 B

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