docker-compose.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. version: "3.5"
  2. services:
  3. mysql_d7:
  4. image: mariadb:latest
  5. volumes:
  6. - db-data-d7:/var/lib/mysql
  7. - ./Docker/mysql/mysql.cnf:/etc/mysql/conf.d/custom.cnf:ro
  8. - "${DB_IMPORTE_FILE_D7}:/docker-entrypoint-initdb.d/popsu_d7.sql"
  9. networks:
  10. - database
  11. environment:
  12. MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
  13. MYSQL_DATABASE: "${DB_NAME_D7}"
  14. MYSQL_USER: "${DB_USERNAME}"
  15. MYSQL_PASSWORD: "${DB_PASSWORD}"
  16. mysql_d9:
  17. image: mariadb:latest
  18. volumes:
  19. - db-data-d9:/var/lib/mysql
  20. - ./Docker/mysql/mysql.cnf:/etc/mysql/conf.d/custom.cnf:ro
  21. - "${DB_IMPORTE_FILE_D9}:/docker-entrypoint-initdb.d/popsu_d9.sql"
  22. networks:
  23. - database
  24. environment:
  25. MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
  26. MYSQL_DATABASE: "${DB_NAME_D9}"
  27. MYSQL_USER: "${DB_USERNAME}"
  28. MYSQL_PASSWORD: "${DB_PASSWORD}"
  29. redis:
  30. image: redis:6
  31. volumes:
  32. - redis-data:/data
  33. networks:
  34. - redis
  35. ports:
  36. - "6379"
  37. php_d7:
  38. build: ./Docker/php-5.6-fpm/
  39. volumes:
  40. - php-d7-user-data:/home/${USER_UNAME}
  41. - "${PROJECT_ROOT_D7}:/var/www/d7"
  42. working_dir: "/var/www/d7"
  43. networks:
  44. - database
  45. - server
  46. - redis
  47. depends_on:
  48. - mysql_d7
  49. - redis
  50. php_d9:
  51. build: ./Docker/php-7.4-fpm/
  52. user: ${USER_UID}:${USER_GID}
  53. volumes:
  54. - php-d9-user-data:/home/${USER_UNAME}
  55. - "${PROJECT_ROOT_D7}:/var/www/d7"
  56. - "${PROJECT_ROOT_D9}:/var/www/d9"
  57. - "${LOG_ROOT}/php:/var/log:rw"
  58. - "${XDEBUG_INI}:/usr/local/etc/php/conf.d/xdebug.ini"
  59. working_dir: "/var/www/d9"
  60. networks:
  61. - database
  62. - redis
  63. - server
  64. # for xdebug
  65. # https://github.com/docker/for-linux/issues/264#issuecomment-965465879
  66. extra_hosts:
  67. - host.docker.internal:host-gateway
  68. depends_on:
  69. - mysql_d9
  70. - redis
  71. phpmyadmin:
  72. image: phpmyadmin/phpmyadmin
  73. ports:
  74. - 8981:80
  75. networks:
  76. - database
  77. depends_on:
  78. - mysql_d7
  79. - mysql_d9
  80. environment:
  81. PMA_HOSTS: mysql_d7,mysql_d9
  82. nginx:
  83. build: ./Docker/nginx/
  84. ports:
  85. - 8980:80
  86. working_dir: "/var/www"
  87. volumes:
  88. - "${PROJECT_ROOT_D7}:/var/www/d7"
  89. - "${PROJECT_ROOT_D9}:/var/www/d9"
  90. - "${LOG_ROOT}:/var/log:rw"
  91. networks:
  92. - server
  93. depends_on:
  94. - php_d7
  95. - php_d9
  96. volumes:
  97. db-data-d7:
  98. db-data-d9:
  99. redis-data:
  100. php-d7-user-data:
  101. php-d9-user-data:
  102. networks:
  103. database:
  104. redis:
  105. server: