docker-compose.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. version : '3.8'
  2. services:
  3. ruoyi-mysql:
  4. container_name: ruoyi-mysql
  5. image: mysql:5.7
  6. build:
  7. context: ./mysql
  8. ports:
  9. - "3306:3306"
  10. volumes:
  11. - ./mysql/conf:/etc/mysql/conf.d
  12. - ./mysql/logs:/logs
  13. - ./mysql/data:/var/lib/mysql
  14. command: [
  15. 'mysqld',
  16. '--innodb-buffer-pool-size=80M',
  17. '--character-set-server=utf8mb4',
  18. '--collation-server=utf8mb4_unicode_ci',
  19. '--default-time-zone=+8:00',
  20. '--lower-case-table-names=1'
  21. ]
  22. environment:
  23. MYSQL_DATABASE: 'ry-cloud'
  24. MYSQL_ROOT_PASSWORD: password
  25. ruoyi-redis:
  26. container_name: ruoyi-redis
  27. image: redis
  28. build:
  29. context: ./redis
  30. ports:
  31. - "6379:6379"
  32. volumes:
  33. - ./redis/conf/redis.conf:/home/ruoyi/redis/redis.conf
  34. - ./redis/data:/data
  35. command: redis-server /home/ruoyi/redis/redis.conf
  36. ruoyi-nginx:
  37. container_name: ruoyi-nginx
  38. image: nginx
  39. build:
  40. context: ./nginx
  41. ports:
  42. - "80:80"
  43. volumes:
  44. - ./nginx/html/dist:/home/ruoyi/projects/ruoyi-ui
  45. - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
  46. - ./nginx/logs:/var/log/nginx
  47. - ./nginx/conf.d:/etc/nginx/conf.d
  48. depends_on:
  49. - ruoyi-gateway
  50. links:
  51. - ruoyi-gateway
  52. ruoyi-admin:
  53. container_name: ruoyi-admin
  54. build:
  55. context: ./ruoyi/admin
  56. dockerfile: dockerfile
  57. ports:
  58. - "8080:8080"
  59. depends_on:
  60. - ruoyi-redis
  61. - ruoyi-mysql
  62. links:
  63. - ruoyi-redis
  64. - ruoyi-mysql