docker-compose.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. version: "3"
  2. services:
  3. nginx:
  4. image: nginx:1.20.2
  5. ports:
  6. - "9100:80"
  7. - "9103:443"
  8. volumes:
  9. - "./nginx/dist:/usr/share/nginx/html"
  10. - "./nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro"
  11. - "./nginx/key:/etc/nginx/key/"
  12. links:
  13. - adminNet
  14. mysql:
  15. image: mysql:5.7
  16. ports:
  17. - 9101:3306
  18. restart: unless-stopped
  19. privileged: true
  20. ulimits:
  21. nproc: 655350
  22. nofile:
  23. soft: 131072
  24. hard: 400000
  25. #healthcheck:
  26. # test: "/usr/bin/mysql --user=root --password=root --execute \"SHOW DATABASES;\""
  27. # interval: 10s # 间隔时间
  28. # timeout: 3s # 超时时间
  29. # retries: 50 # 重试次数
  30. environment:
  31. MYSQL_ROOT_HOST: "%"
  32. MYSQL_DATABASE: admin
  33. MYSQL_ROOT_PASSWORD: root
  34. volumes:
  35. - ./mysql/mysql:/var/lib/mysql
  36. - ./mysql/mysql.cnf:/etc/mysql/conf.d/mysql.cnf
  37. adminNet:
  38. image: mcr.microsoft.com/dotnet/aspnet:6.0
  39. ports:
  40. - "9102:5050"
  41. volumes:
  42. - "./app:/app"
  43. working_dir: /app
  44. command: ["/app/wait-for-it.sh", "mysql:3306", "-t", "120", "--","dotnet", "Admin.NET.Web.Entry.dll"]
  45. depends_on:
  46. - mysql