docker-compose.yaml 1004 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. version: "3.7"
  2. services:
  3. db:
  4. image: mysql:8.0.19
  5. command: '--default-authentication-plugin=mysql_native_password'
  6. restart: always
  7. healthcheck:
  8. test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
  9. interval: 3s
  10. retries: 5
  11. start_period: 30s
  12. secrets:
  13. - db-password
  14. volumes:
  15. - db-data:/var/lib/mysql
  16. networks:
  17. - backnet
  18. environment:
  19. - MYSQL_DATABASE=example
  20. - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password
  21. expose:
  22. - 3306
  23. - 33060
  24. backend:
  25. build: backend
  26. restart: always
  27. secrets:
  28. - db-password
  29. ports:
  30. - 5000:5000
  31. networks:
  32. - backnet
  33. - frontnet
  34. depends_on:
  35. db:
  36. condition: service_healthy
  37. proxy:
  38. build: proxy
  39. restart: always
  40. ports:
  41. - 80:80
  42. depends_on:
  43. - backend
  44. networks:
  45. - frontnet
  46. volumes:
  47. db-data:
  48. secrets:
  49. db-password:
  50. file: db/password.txt
  51. networks:
  52. backnet:
  53. frontnet: