docker-compose.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. version: "3.5"
  2. services:
  3. mysql:
  4. image: mariadb:latest
  5. volumes:
  6. - db-data:/var/lib/mysql
  7. - ./Docker/mysql/mysql.cnf:/etc/mysql/conf.d/custom.cnf:ro
  8. - "${DB_IMPORTE_FILE}:/docker-entrypoint-initdb.d/erable.sql"
  9. networks:
  10. - database
  11. environment:
  12. MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
  13. MYSQL_DATABASE: "${DB_NAME}"
  14. MYSQL_USER: "${DB_USERNAME}"
  15. MYSQL_PASSWORD: "${DB_PASSWORD}"
  16. redis:
  17. image: redis:6
  18. volumes:
  19. - redis-data:/data
  20. networks:
  21. - redis
  22. ports:
  23. - "6379"
  24. php:
  25. build: ./Docker/php-8.1-fpm/
  26. user: ${USER_UID}:${USER_GID}
  27. volumes:
  28. - php-user-data:/home/${USER_UNAME}
  29. - "${PROJECT_ROOT}:/var/www/erable"
  30. - "${LOG_ROOT}/php:/var/log:rw"
  31. - "${XDEBUG_INI}:/usr/local/etc/php/conf.d/xdebug.ini"
  32. working_dir: "/var/www/erable/"
  33. networks:
  34. - database
  35. - redis
  36. - server
  37. # for xdebug
  38. # https://github.com/docker/for-linux/issues/264#issuecomment-965465879
  39. extra_hosts:
  40. - host.docker.internal:host-gateway
  41. depends_on:
  42. - mysql
  43. - redis
  44. phpmyadmin:
  45. image: phpmyadmin/phpmyadmin
  46. ports:
  47. - 8981:80
  48. networks:
  49. - database
  50. depends_on:
  51. - mysql
  52. environment:
  53. PMA_HOSTS: mysql
  54. nginx:
  55. build: ./Docker/nginx/
  56. ports:
  57. - 8980:80
  58. working_dir: "/var/www"
  59. volumes:
  60. - "${PROJECT_ROOT}:/var/www/erable"
  61. - "${LOG_ROOT}:/var/log:rw"
  62. networks:
  63. - server
  64. depends_on:
  65. - php
  66. volumes:
  67. db-data:
  68. redis-data:
  69. php-user-data:
  70. networks:
  71. database:
  72. redis:
  73. server: