加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
docker-compose.sample.yml 4.51 KB
一键复制 编辑 原始数据 按行查看 历史
xiaoshangmin 提交于 2024-08-26 15:56 . u
version: "3.8"
services:
php:
image: ${PHP_VERSION}
container_name: php
restart: always
ports:
- "9000:9000"
- "9501:9501"
- "9503:9503"
volumes:
- ${PHP_CONF_DIR}/php.ini:/usr/local/etc/php/php.ini:ro
- ${PHP_CONF_DIR}/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf:ro
- ${DATA_DIR}/composer:/tmp/composer
- ${LOG_DIR}/php:/var/log/php:rw
- ./www:/var/www/html:rw
environment:
TZ: "${TIMEZONE}"
tty: true
networks:
- elk
openresty:
image: ${OPENRESTY_VERSION}
container_name: openresty
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ${OPENRESTY_CONF_DIR}/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf:ro
- ${OPENRESTY_CONF_DIR}/conf.d/:/etc/nginx/conf.d/:rw
- ${OPENRESTY_CONF_DIR}/cert:/etc/nginx/cert:ro
- ${LOG_DIR}/nginx:/var/log/nginx:rw
- ./www:/var/www/html:rw
environment:
TZ: "${TIMEZONE}"
networks:
- elk
mysql:
image: ${MYSQL_VERSION}
container_name: mysql
restart: always
ports:
- "3306:3306"
volumes:
- ${MYSQL_CONF_DIR}/mysql.cnf:/etc/mysql/conf.d/mysql.cnf:ro
- ${MYSQL_LIB_DIR}:/var/lib/mysql:rw
environment:
MYSQL_SQL_MODE: STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
TZ: "${TIMEZONE}"
networks:
- elk
redis:
image: ${REDIS_VERSION}
container_name: redis
restart: always
ports:
- "6379:6379"
volumes:
- ${DATA_DIR}/redis:/data:rw
- ${REDIS_CONF_DIR}/redis.conf:/etc/redis.conf:ro
environment:
TZ: "${TIMEZONE}"
networks:
- elk
nacos:
image: ${NACOS_VERSION}
container_name: nacos
restart: on-failure
ports:
- "8849:8849"
- "8848:8848"
volumes:
- ${LOG_DIR}/nacos/:/home/nacos/logs
- ${NACOS_CONF_DIR}/conf/application.properties:/home/nacos/conf/application.properties
depends_on:
- "mysql"
tty: true
networks:
- elk
# rabbitmq:
# image: xiaoshangmin/rabbitmq
# container_name: rabbitmq
# restart: always
# ports:
# - "5672:5672"
# - "15672:15672"
# volumes:
# - ./data/rabbitmq:/var/lib/rabbitmq/mnesia:rw
# - ./logs/rabbitmq:/var/log/rabbitmq:rw
# - ./rabbitmq/etc/:/etc/rabbitmq:rw
# environment:
# - RABBITMQ_DEFAULT_USER=admin
# - RABBITMQ_DEFAULT_PASS=admin
# networks:
# - "default"
# elasticsearch:
# image: elasticsearch:7.17.5
# container_name: elasticsearch
# hostname: elasticsearch
# restart: always
# volumes:
# #多个容器之间共享数据卷,须在顶级的 volumes 节点中定义这个数据卷elasticsearch
# - elasticsearch:/usr/share/elasticsearch/data:z
# - ./data/esdata:/usr/share/elasticsearch/data:z
# - ./elk/es/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro,z
# environment:
# discovery.type: single-node
# ES_JAVA_OPTS: -Xmx512m -Xms512m
# ports:
# - "9200:9200"
# - "9300:9300"
# networks:
# - elk
# filebeat:
# image: elastic/filebeat:7.17.5
# container_name: filebeat
# user: root
# volumes:
# - ./elk/filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
# - /var/lib/docker/containers:/var/lib/docker/containers:ro
# networks:
# - "default"
# depends_on:
# - "logstash"
# logstash:
# image: logstash:7.17.5
# container_name: logstash
# hostname: logstash
# restart: always
# volumes:
# - ./elk/logstash/pipeline:/usr/share/logstash/pipeline:ro,Z
# - ./elk/logstash/logstash.yml:/usr/share/logstash/config/logstash.yml:ro,Z
# - ${LOG_DIR}/nginx:/var/log/nginx:rw
# environment:
# LS_JAVA_OPTS: -Xmx512m -Xms512m
# ports:
# - "5044:5044"
# - "5000:5000/tcp"
# - "5000:5000/udp"
# - "9600:9600"
# networks:
# - elk
# depends_on:
# - elasticsearch
# kibana:
# image: kibana:7.17.5
# container_name: kibana
# hostname: kibana
# restart: always
# volumes:
# - ./elk/kibana/kibana.yml:/usr/share/kibana/config/kibana.yml:ro,Z
# ports:
# - "5601:5601"
# environment:
# I18N_LOCALE: "zh-CN"
# elasticsearch.hosts: http://elasticsearch:9200
# depends_on:
# - elasticsearch
# networks:
# - elk
# volumes:
# elasticsearch:
networks:
elk:
driver: bridge
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化