1 Star 0 Fork 12

immortal/dnmp

forked from xiaoyu/dnmp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
compose.sample.yml 11.91 KB
一键复制 编辑 原始数据 按行查看 历史
services:
# 使用前最好阅读一遍(README.md)说明文件,以便快速上手,遇到问题也能及时排查
mysql8.0:
image: mysql:8.0
container_name: mysql80
restart: always
privileged: true
ports:
- "3306:3306"
volumes:
- "./servers/mysql/mysql8.0:/etc/mysql" # 配置文件
- "./data/mysql/mysql8.0:/var/lib/mysql" # 数据库文件
- "./logs/mysql/mysql8.0:/var/log/mysql" # 日志文件
environment:
- "TZ=${TZ}"
- "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD_80}"
- "MYSQL_ROOT_HOST=${MYSQL_ROOT_HOST_80}"
- "MYSQL_USER=${MYSQL_USER_80}"
- "MYSQL_PASSWORD=${MYSQL_PASSWORD_80}"
networks:
- dnmp-net
redis6.2:
image: redis:6.2-alpine
container_name: redis62
restart: always
ports:
- "6379:6379"
volumes:
- "./servers/redis/redis6.2:/etc/redis" # 配置文件
- "./data/redis/redis6.2:/data" # 数据文件
- "./logs/redis/redis6.2:/var/log/redis" # 日志文件
environment:
- "TZ=${TZ}"
entrypoint: ["redis-server", "/etc/redis/docker.conf", "--requirepass", "${REDIS_PASSWORD_62}"]
networks:
- dnmp-net
php72:
build:
context: ./servers/php/php7.2
args:
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS_72: ${PHP_EXTENSIONS_72}
COMPOSER_IMAGE_URL: ${COMPOSER_IMAGE_URL}
COMPOSER_DOWNLOAD_URL: ${COMPOSER_DOWNLOAD_URL}
TZ: ${TZ}
container_name: php72
restart: always
ports:
- "9000:9000"
volumes:
- "./servers/php/php7.2/php.ini:/usr/local/etc/php/php.ini:ro" # php.ini
- "./servers/php/php7.2/php-fpm.conf:/usr/local/etc/php-fpm.conf:rw" # php-fpm.conf
- "./servers/php/php7.2/php-fpm.d:/usr/local/etc/php-fpm.d" # php-fpm.d
- "./servers/panel:/usr/panel" # nginx使用unix sock连接文件
- "./logs/php/php7.2:/var/log/php" # 日志文件
- "./www:/var/www/html" # 文件路径
cap_add:
- SYS_PTRACE
networks:
- dnmp-net
php73:
build:
context: ./servers/php/php7.3
args:
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS_73: ${PHP_EXTENSIONS_73}
COMPOSER_IMAGE_URL: ${COMPOSER_IMAGE_URL}
COMPOSER_DOWNLOAD_URL: ${COMPOSER_DOWNLOAD_URL}
TZ: ${TZ}
container_name: php73
restart: always
ports:
- "9001:9000"
volumes:
- "./servers/php/php7.3/php.ini:/usr/local/etc/php/php.ini:ro" # php.ini
- "./servers/php/php7.3/php-fpm.conf:/usr/local/etc/php-fpm.conf:rw" # php-fpm.conf
- "./servers/php/php7.3/php-fpm.d:/usr/local/etc/php-fpm.d" # php-fpm.d
- "./servers/panel:/usr/panel" # nginx使用unix sock连接文件
- "./logs/php/php7.3:/var/log/php" # 日志文件
- "./www:/var/www/html" # 文件路径
cap_add:
- SYS_PTRACE
networks:
- dnmp-net
php74:
build:
context: ./servers/php/php7.4
args:
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS_74: ${PHP_EXTENSIONS_74}
COMPOSER_IMAGE_URL: ${COMPOSER_IMAGE_URL}
COMPOSER_DOWNLOAD_URL: ${COMPOSER_DOWNLOAD_URL}
TZ: ${TZ}
container_name: php74
restart: always
ports:
- "9002:9000"
volumes:
- "./servers/php/php7.4/php.ini:/usr/local/etc/php/php.ini:ro" # php.ini
- "./servers/php/php7.4/php-fpm.conf:/usr/local/etc/php-fpm.conf:rw" # php-fpm.conf
- "./servers/php/php7.4/php-fpm.d:/usr/local/etc/php-fpm.d" # php-fpm.d
- "./servers/panel:/usr/panel" # nginx使用unix连接文件
- "./logs/php/php7.4:/var/log/php" # 日志文件
- "./www:/var/www/html" # 文件路径
cap_add:
- SYS_PTRACE
networks:
- dnmp-net
php80:
build:
context: ./servers/php/php8.0
args:
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS_80: ${PHP_EXTENSIONS_80}
COMPOSER_IMAGE_URL: ${COMPOSER_IMAGE_URL}
COMPOSER_DOWNLOAD_URL: ${COMPOSER_DOWNLOAD_URL}
TZ: ${TZ}
container_name: php80
restart: always
ports:
- "9003:9000"
volumes:
- "./servers/php/php8.0/php.ini:/usr/local/etc/php/php.ini:ro" # php.ini
- "./servers/php/php8.0/php-fpm.conf:/usr/local/etc/php-fpm.conf:rw" # php-fpm.conf
- "./servers/php/php8.0/php-fpm.d:/usr/local/etc/php-fpm.d" # php-fpm.d
- "./servers/panel:/usr/panel" # nginx使用unix连接文件
- "./logs/php/php8.0:/var/log/php" # 日志文件
- "./www:/var/www/html" # 文件路径
cap_add:
- SYS_PTRACE
networks:
- dnmp-net
php81:
build:
context: ./servers/php/php8.1
args:
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS_81: ${PHP_EXTENSIONS_81}
COMPOSER_IMAGE_URL: ${COMPOSER_IMAGE_URL}
COMPOSER_DOWNLOAD_URL: ${COMPOSER_DOWNLOAD_URL}
TZ: ${TZ}
container_name: php81
restart: always
ports:
- "9004:9000"
volumes:
- "./servers/php/php8.1/php.ini:/usr/local/etc/php/php.ini:ro" # php.ini
- "./servers/php/php8.1/php-fpm.conf:/usr/local/etc/php-fpm.conf:rw" # php-fpm.conf
- "./servers/php/php8.1/php-fpm.d:/usr/local/etc/php-fpm.d" # php-fpm.d
- "./servers/panel:/usr/panel" # nginx使用unix连接文件
- "./logs/php/php8.1:/var/log/php" # 日志文件
- "./www:/var/www/html" # 文件路径
cap_add:
- SYS_PTRACE
networks:
- dnmp-net
php82:
build:
context: ./servers/php/php8.2
args:
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS_82: ${PHP_EXTENSIONS_82}
COMPOSER_IMAGE_URL: ${COMPOSER_IMAGE_URL}
COMPOSER_DOWNLOAD_URL: ${COMPOSER_DOWNLOAD_URL}
TZ: ${TZ}
container_name: php82
restart: always
ports:
- "9005:9000"
volumes:
- "./servers/php/php8.2/php.ini:/usr/local/etc/php/php.ini:ro" # php.ini
- "./servers/php/php8.2/php-fpm.conf:/usr/local/etc/php-fpm.conf:rw" # php-fpm.conf
- "./servers/php/php8.2/php-fpm.d:/usr/local/etc/php-fpm.d" # php-fpm.d
- "./servers/panel:/usr/panel" # nginx使用unix连接文件
- "./logs/php/php8.2:/var/log/php" # 日志文件
- "./www:/var/www/html" # 文件路径
cap_add:
- SYS_PTRACE
networks:
- dnmp-net
php83:
build:
context: ./servers/php/php8.3
args:
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS_83: ${PHP_EXTENSIONS_83}
COMPOSER_IMAGE_URL: ${COMPOSER_IMAGE_URL}
COMPOSER_DOWNLOAD_URL: ${COMPOSER_DOWNLOAD_URL}
TZ: ${TZ}
container_name: php83
restart: always
ports:
- "9006:9000"
volumes:
- "./servers/php/php8.3/php.ini:/usr/local/etc/php/php.ini:ro" # php.ini
- "./servers/php/php8.3/php-fpm.conf:/usr/local/etc/php-fpm.conf:rw" # php-fpm.conf
- "./servers/php/php8.3/php-fpm.d:/usr/local/etc/php-fpm.d" # php-fpm.d
- "./servers/panel:/usr/panel" # nginx使用unix连接文件
- "./logs/php/php8.3:/var/log/php" # 日志文件
- "./www:/var/www/html" # 文件路径
cap_add:
- SYS_PTRACE
networks:
- dnmp-net
nginx1.21:
image: nginx:1.21-alpine
container_name: nginx1.21
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- "./servers/nginx/nginx1.21:/etc/nginx" # 配置文件
- "./servers/panel:/usr/panel" # php unix连接文件
- "./logs/nginx/nginx1.21:/var/log/nginx" # 日志文件
- "./www:/usr/share/nginx/html" # 文件路径
environment:
- "TZ=${TZ}"
networks:
- dnmp-net
mongo6.0:
image: mongo:6.0
container_name: mongodb60
restart: always
ports:
- "27017:27017"
volumes:
- "./data/mongo/mongo6.0:/var/lib/mongodb:rw" # 数据库文件
- "./logs/mongo/mongo6.0:/var/log/mongodb:rw" # 日志文件
- "./servers/mongo/mongo6.0/mongo.conf:/etc/mongo.conf:ro" # 配置文件
environment:
- "TZ=${TZ}"
- "MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME_60}"
- "MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD_60}"
command: "mongod --config /etc/mongo.conf"
networks:
- dnmp-net
mongo-express:
image: mongo-express
container_name: mongo-express
restart: always
ports:
- "8081:8081"
environment:
- "TZ=${TZ}"
- "ME_CONFIG_MONGODB_ADMINUSERNAME=${ME_CONFIG_MONGODB_ADMINUSERNAME}"
- "ME_CONFIG_MONGODB_ADMINPASSWORD=${ME_CONFIG_MONGODB_ADMINPASSWORD}"
- "ME_CONFIG_MONGODB_URL=${ME_CONFIG_MONGODB_URL}"
depends_on:
- mongo6.0
networks:
- dnmp-net
rabbitmq3.11:
build:
context: ./servers/rabbitmq/rabbitmq3.11
args:
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
RABBITMQ_PLUGINS_3_11: ${RABBITMQ_PLUGINS_3_11}
TZ: ${TZ}
container_name: rabbitmq3.11
hostname: rabbitmq3.11 # RabbitMQ的一个重要注意事项是它根据所谓的 “节点名称” 存储数据,默认为主机名
restart: always
ports:
- "5672:5672"
- "15672:15672"
volumes:
- "./servers/rabbitmq/rabbitmq3.11/conf.d/10-defaults.conf:/etc/rabbitmq/conf.d/10-defaults.conf:ro" # 配置文件
- "./data/rabbitmq/rabbitmq3.11:/var/lib/rabbitmq/mnesia:rw" # 数据文件
- "./logs/rabbitmq/rabbitmq3.11:/var/log/rabbitmq:rw" # 日志文件
environment:
- "RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER_3_11}"
- "RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS_3_11}"
networks:
- dnmp-net
elasticsearch8.4:
image: elasticsearch:8.4.0
container_name: elasticsearch8.4
restart: always
privileged: true
ports:
- "9200:9200"
- "9300:9300"
volumes:
- "./data/elasticsearch/elasticsearch8.4:/usr/share/elasticsearch/data" # 数据文件
- "./logs/elasticsearch/elasticsearch8.4:/usr/share/elasticsearch/logs" # 日志文件
- "./plugins/elasticsearch/elasticsearch8.4:/usr/share/elasticsearch/plugins" # 插件文件
- "./servers/elasticsearch/elasticsearch8.4/config:/usr/share/elasticsearch/config" # 配置文件
environment:
- "TZ=${TZ}"
- "discovery.type=single-node" # 单节点设置
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" # 设置内存大小
networks:
- dnmp-net
kibana8.4:
image: kibana:8.4.0
container_name: kibana8.4
restart: always
ports:
- "5601:5601"
volumes:
- "./servers/kibana/kibana8.4/kibana.yml:/usr/share/kibana/config/kibana.yml:ro" # 配置文件
environment:
- "TZ=${TZ}"
- "ELASTICSEARCH_HOSTS=${KIBANA_ELASTICSEARCH_HOSTS_84}"
- "ELASTICSEARCH_USERNAME=${KIBANA_ELASTICSEARCH_USERNAME_84}"
- "ELASTICSEARCH_PASSWORD=${KIBANA_ELASTICSEARCH_PASSWORD_84}"
- "I18N_LOCALE=zh-CN"
depends_on: # 依赖ES先启动
- elasticsearch8.4
networks:
- dnmp-net
networks:
dnmp-net:
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Docker
1
https://gitee.com/q326132121/dnmp.git
git@gitee.com:q326132121/dnmp.git
q326132121
dnmp
dnmp
main

搜索帮助