docker-compose.yml 1.3 KB

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