docker-compose.yaml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. version : '3'
  2. services:
  3. mysql:
  4. # platform: linux/x86_64
  5. container_name: mysql
  6. image: mysql:5.7
  7. build:
  8. context: .
  9. dockerfile: mysql-dockerfile
  10. ports:
  11. - "3306:3306"
  12. volumes:
  13. - ./mysql/conf:/etc/mysql/conf.d
  14. - ./mysql/logs:/logs
  15. - ./mysql/data:/var/lib/mysql
  16. command: [
  17. 'mysqld',
  18. '--innodb-buffer-pool-size=80M',
  19. '--character-set-server=utf8mb4',
  20. '--collation-server=utf8mb4_unicode_ci',
  21. '--default-time-zone=+8:00',
  22. '--lower-case-table-names=1'
  23. ]
  24. environment:
  25. MYSQL_DATABASE: ${DB_NAME}
  26. MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
  27. redis:
  28. image: redis:5.0
  29. ports:
  30. - "6379:6379"
  31. restart: always
  32. zyc-server:
  33. container_name: zyc-server
  34. build:
  35. context: .
  36. dockerfile: zyc-dockerfile
  37. ports:
  38. - "80:80"
  39. volumes:
  40. - ./zyc/logs:/home/zyc/logs
  41. - ./zyc/uploadPath:/home/zyc/uploadPath
  42. depends_on:
  43. - mysql
  44. links:
  45. - mysql
  46. environment:
  47. DB_HOST: ${DB_HOST}
  48. DB_USERNAME: ${DB_USERNAME}
  49. DB_PASSWORD: ${DB_PASSWORD}
  50. DB_NAME: ${DB_NAME}
  51. DB_PORT: ${DB_PORT}
  52. REDIS_HOST: ${REDIS_HOST}
  53. REDIS_PORT: ${REDIS_PORT}
  54. REDIS_PASSWORD: ${REDIS_PASSWORD}
  55. REDIS_DATABASE: ${REDIS_DATABASE}