1. version: "3.7"
  2. services:
  3. nginx:
  4. image: nginx:1.23.3-alpine
  5. container_name: nginx
  6. restart: always
  7. depends_on:
  8. - php7.4
  9. - nvm
  10. ports:
  11. - "80:80"
  12. volumes:
  13. - ./services/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
  14. - ./services/nginx/conf/default.conf:/etc/nginx/conf.d/default.conf
  15. - ./logs/nginx:/var/log/nginx
  16. - ${WWW_DIR}:/usr/share/nginx/html
  17. networks:
  18. - base_default
  19. php7.4:
  20. user: "1000:1000"
  21. build:
  22. context: ./services/php7.4
  23. args:
  24. CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
  25. TZ: ${TZ}
  26. container_name: php7.4
  27. extra_hosts:
  28. #设置回环IP,可以通过此域名访问主机IP
  29. - host.docker.internal:host-gateway
  30. restart: always
  31. # ports:
  32. # - "9000:9000"
  33. stdin_open: true
  34. tty: true
  35. environment:
  36. - TZ=${TZ}
  37. volumes:
  38. - ${WWW_DIR}:/var/www
  39. #- ./services/php7.4/etc/:/usr/local/etc/
  40. - ./services/php7.4/etc/php.ini:/usr/local/etc/php/php.ini
  41. - ./services/php7.4/etc/www.conf:/usr/local/etc/php-fpm.d/www.conf
  42. - ./logs/php74:/var/log/php
  43. networks:
  44. - base_default
  45. nvm:
  46. build:
  47. context: ./services/nvm
  48. args:
  49. CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
  50. TZ: ${TZ}
  51. container_name: nvm
  52. restart: always
  53. user: root
  54. stdin_open: true
  55. tty: true
  56. ports:
  57. - "3000-3010:3000-3010"
  58. volumes:
  59. - ${WWW_DIR}:/www/:cached
  60. networks:
  61. - base_default
  62. # mysql8:
  63. # image: mysql:8
  64. # container_name: mysql8
  65. # restart: always
  66. # ports:
  67. # - "3306:3306"
  68. # command: --default-authentication-plugin=mysql_native_password
  69. # volumes:
  70. # - ./data/mysql:/var/lib/mysql
  71. # environment:
  72. # MYSQL_ROOT_PASSWORD: admin123123
  73. # networks:
  74. # - base_default
  75. # hyperf:
  76. # image: hyperf/hyperf:8.0-alpine-v3.15-swoole
  77. # container_name: hyperf
  78. # restart: always
  79. # user: root
  80. # stdin_open: true
  81. # tty: true
  82. # ports:
  83. # - "9501:9501"
  84. # volumes:
  85. # - ./www/project:/data/project
  86. # networks:
  87. # - base_default
  88. networks:
  89. base_default:
  90. external: true