1. version: "3.7"
  2. services:
  3. 521php_nginx:
  4. image: nginx:1.23.3
  5. container_name: 521php_nginx
  6. depends_on:
  7. - 521php_php
  8. extra_hosts:
  9. #设置回环IP,可以通过此域名访问主机IP
  10. - host.docker.internal:host-gateway
  11. restart: always
  12. ports:
  13. - "80:80"
  14. - "443:443"
  15. volumes:
  16. - ./services/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
  17. - ./services/nginx/conf/conf.d:/etc/nginx/conf.d
  18. - ./services/nginx/cert:/home/cert #https证书
  19. - ./logs/nginx:/var/log/nginx
  20. - ./www:/usr/share/nginx/html
  21. # command:
  22. # - sh
  23. # - -c
  24. # - |
  25. # /usr/share/nginx/mindoc/mindoc_linux_amd64 &
  26. # nginx -g "daemon off;"
  27. # entrypoint:
  28. # - /usr/share/nginx/mindoc/mindoc_linux_amd64
  29. networks:
  30. - default
  31. 521php_php:
  32. build:
  33. context: ./services/php
  34. container_name: 521php_php
  35. restart: always
  36. volumes:
  37. - ./services/php/etc:/usr/local/etc
  38. - ./logs/php:/var/log/php
  39. - ./www:/var/www
  40. networks:
  41. - default
  42. 521php_centos7:
  43. image: centos:centos7
  44. container_name: 521php_centos7
  45. restart: always
  46. # ports:
  47. # - "80:80"
  48. volumes:
  49. - ./www/mindoc:/home/www/mindoc
  50. command:
  51. - sh
  52. - -c
  53. - |
  54. /home/www/mindoc/mindoc_linux_amd64
  55. networks:
  56. - default
  57. 521php_mysql5:
  58. image: mysql:5.5.48
  59. container_name: 521php_mysql5
  60. restart: always
  61. ports:
  62. - "3306:3306"
  63. #command: --default-authentication-plugin=mysql_native_password
  64. volumes:
  65. - ./data/mysql:/var/lib/mysql
  66. environment:
  67. MYSQL_ROOT_PASSWORD: xxxxx
  68. networks:
  69. - default
  70. networks:
  71. default: