docker-compose.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. version: "3.8"
  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. - ./Docker/mysql/bashrc:/root/.bashrc:ro
  9. - "${DB_IMPORTE_FILE}:/docker-entrypoint-initdb.d/enfrancais.sql"
  10. networks:
  11. - database
  12. hostname: mysql
  13. environment:
  14. MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
  15. MYSQL_DATABASE: "${DB_NAME}"
  16. MYSQL_USER: "${DB_USERNAME}"
  17. MYSQL_PASSWORD: "${DB_PASSWORD}"
  18. redis:
  19. image: redis:4
  20. command: ["redis-server", "--appendonly", "yes"]
  21. volumes:
  22. - redis-data:/data
  23. networks:
  24. - redis
  25. ports:
  26. - "6389"
  27. phpmyadmin:
  28. image: phpmyadmin/phpmyadmin
  29. ports:
  30. - 8991:80
  31. networks:
  32. - database
  33. depends_on:
  34. - mysql
  35. environment:
  36. PMA_HOSTS: mysql,mysql-legacy
  37. api:
  38. build: ./Docker/api/
  39. expose:
  40. - 9000
  41. user: ${USER_UID}:${USER_GID}
  42. volumes:
  43. - php-user-data:/home/${USER_UNAME}
  44. - "${API_ROOT}:/var/www/html/api"
  45. - "${LOG_ROOT}/php:/var/log:rw"
  46. working_dir: "/var/www/html/api/src"
  47. networks:
  48. - database
  49. - redis
  50. - server
  51. depends_on:
  52. - mysql
  53. - redis
  54. app:
  55. build: ./Docker/app
  56. user: ${USER_UID}:${USER_GID}
  57. volumes:
  58. - "${APP_ROOT}:/app"
  59. - npm-user-data:/home/${USER_UNAME}
  60. networks:
  61. - app
  62. - server
  63. ports:
  64. - 8988:8988
  65. working_dir: "/app"
  66. environment:
  67. - APP_ENV=dev
  68. nginx:
  69. build: ./Docker/nginx/
  70. ports:
  71. - 8990:80
  72. volumes:
  73. - "${API_ROOT}:/var/www/html/api"
  74. - "${APP_ROOT}:/var/www/html/app"
  75. - "${LOG_ROOT}:/var/log:rw"
  76. working_dir: "/var/www/html/api/"
  77. networks:
  78. - server
  79. depends_on:
  80. - api
  81. - app
  82. # command: [nginx-debug, '-g', 'daemon off;']
  83. volumes:
  84. php-user-data:
  85. db-data:
  86. redis-data:
  87. npm-user-data:
  88. networks:
  89. database:
  90. redis:
  91. server:
  92. app: