docker-compose.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. version: "3.4"
  2. name: yudao-system
  3. services:
  4. mysql:
  5. container_name: yudao-mysql
  6. image: mysql:8
  7. restart: unless-stopped
  8. tty: true
  9. ports:
  10. - "3306:3306"
  11. environment:
  12. MYSQL_DATABASE: ${MYSQL_DATABASE:-ruoyi-vue-pro}
  13. MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-123456}
  14. volumes:
  15. - mysql:/var/lib/mysql/
  16. - ./sql/mysql/ruoyi-vue-pro.sql:/docker-entrypoint-initdb.d/ruoyi-vue-pro.sql:ro
  17. redis:
  18. container_name: yudao-redis
  19. image: redis:6-alpine
  20. restart: unless-stopped
  21. ports:
  22. - "6379:6379"
  23. volumes:
  24. - redis:/data
  25. server:
  26. container_name: yudao-server
  27. build:
  28. context: ./yudao-server/
  29. image: yudao-server
  30. restart: unless-stopped
  31. ports:
  32. - "48080:48080"
  33. environment:
  34. # https://github.com/polovyivan/docker-pass-configs-to-container
  35. SPRING_PROFILES_ACTIVE: local
  36. JAVA_OPTS:
  37. ${JAVA_OPTS:-
  38. -Xms512m
  39. -Xmx512m
  40. -Djava.security.egd=file:/dev/./urandom
  41. }
  42. ARGS:
  43. --spring.datasource.dynamic.datasource.master.url=${MASTER_DATASOURCE_URL:-jdbc:mysql://yudao-mysql:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true}
  44. --spring.datasource.dynamic.datasource.master.username=${MASTER_DATASOURCE_USERNAME:-root}
  45. --spring.datasource.dynamic.datasource.master.password=${MASTER_DATASOURCE_PASSWORD:-123456}
  46. --spring.datasource.dynamic.datasource.slave.url=${SLAVE_DATASOURCE_URL:-jdbc:mysql://yudao-mysql:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true}
  47. --spring.datasource.dynamic.datasource.slave.username=${SLAVE_DATASOURCE_USERNAME:-root}
  48. --spring.datasource.dynamic.datasource.slave.password=${SLAVE_DATASOURCE_PASSWORD:-123456}
  49. --spring.redis.host=${REDIS_HOST:-yudao-redis}
  50. depends_on:
  51. - mysql
  52. - redis
  53. admin:
  54. container_name: yudao-admin
  55. build:
  56. context: ./yudao-ui-admin
  57. args:
  58. NODE_ENV:
  59. ENV=${NODE_ENV:-production}
  60. PUBLIC_PATH=${PUBLIC_PATH:-/}
  61. VUE_APP_TITLE=${VUE_APP_TITLE:-芋道管理系统}
  62. VUE_APP_BASE_API=${VUE_APP_BASE_API:-/prod-api}
  63. VUE_APP_APP_NAME=${VUE_APP_APP_NAME:-/}
  64. VUE_APP_TENANT_ENABLE=${VUE_APP_TENANT_ENABLE:-true}
  65. VUE_APP_CAPTCHA_ENABLE=${VUE_APP_CAPTCHA_ENABLE:-true}
  66. VUE_APP_DOC_ENABLE=${VUE_APP_DOC_ENABLE:-true}
  67. VUE_APP_BAIDU_CODE=${VUE_APP_BAIDU_CODE:-fadc1bd5db1a1d6f581df60a1807f8ab}
  68. image: yudao-admin
  69. restart: unless-stopped
  70. ports:
  71. - "8080:80"
  72. depends_on:
  73. - server
  74. volumes:
  75. mysql:
  76. driver: local
  77. redis:
  78. driver: local