docker-compose.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. version: '3'
  2. networks:
  3. default:
  4. driver: bridge
  5. services:
  6. nginx:
  7. container_name: ${ABBREVIATION}-nginx
  8. image: docker.io/nginx:1.23.0
  9. restart: always
  10. depends_on:
  11. - "php"
  12. volumes:
  13. - ./www:/www
  14. - ./config/nginx/conf.d:/etc/nginx/conf.d
  15. - ./logs/nginx/logs:/logs
  16. networks:
  17. - default
  18. ports:
  19. - "${NUMBER}080:80"
  20. php:
  21. container_name: ${ABBREVIATION}-php-fpm
  22. image: likeshop/php:8.0.22-fpm
  23. restart: always
  24. working_dir: /www/server
  25. volumes:
  26. - ./www:/www
  27. - ./config/php/php.ini:/usr/local/etc/php/php.ini
  28. networks:
  29. - default
  30. mysql:
  31. container_name: ${ABBREVIATION}-mysql
  32. image: mysql:5.7.29 #X86架构
  33. restart: always
  34. ports:
  35. - "${NUMBER}3306:3306"
  36. volumes:
  37. - ./data/mysql/lib:/var/lib/mysql
  38. - ./config/mysql/mysqld.cnf:/etc/mysql/my.cnf
  39. environment:
  40. MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
  41. TZ: "Asia/Shanghai"
  42. networks:
  43. - default
  44. redis:
  45. container_name: ${ABBREVIATION}-redis
  46. image: docker.io/redis:6.2.7
  47. restart: always
  48. volumes:
  49. - ./data/redis:/data
  50. networks:
  51. - default
  52. ports:
  53. - "${NUMBER}6379:6379"