version: '3' services: # RabbitMQ rabbitmq: image: rabbitmq:3.12.7-management ports: - "5672:5672" - "15672:15672" container_name: rabbitmq volumes: - ./rabbitmq/plugins/rabbitmq_delayed_message_exchange-3.12.0.ez:/plugins/rabbitmq_delayed_message_exchange-3.12.0.ez - ./rabbitmq/plugins/enabled_plugins:/etc/rabbitmq/enabled_plugins - ./rabbitmq/data:/var/lib/rabbitmq - ./rabbitmq/log:/var/lib/rabbitmq environment: #rabbitmq的初始用户名 RABBITMQ_DEFAULT_USER: guest #rabbitmq的初始密码 RABBITMQ_DEFAULT_PASS: guest network_mode: "host" # Elasticsearch服务 elasticsearch: image: elasticsearch:7.14.0 ports: - "9200:9200" container_name: elasticsearch volumes: - ./es/data:/usr/share/elasticsearch/data - ./es/plugins:/usr/share/elasticsearch/plugins - ./es/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml environment: - discovery.type=single-node - bootstrap.memory_lock=true - ELASTIC_PASSWORD="123456" - "ES_JAVA_OPTS=-Xms512m -Xmx512m" network_mode: "host" redis: container_name: redis image: redis:6.2.7 ports: - "16789:16789" volumes: - ./redis/redis.conf:/etc/redis/redis.conf - ./redis/data:/data command: redis-server /etc/redis/redis.conf network_mode: "host" # MySQL服务 mysql: container_name: mysql image: mysql:8.0.33 ports: - "3306:3306" environment: MYSQL_ROOT_PASSWORD: '123456' MYSQL_ALLOW_EMPTY_PASSWORD: 'no' MYSQL_DATABASE: 'wayn_shop' volumes: - ./mysql/data:/var/lib/mysql - ./db-init:/docker-entrypoint-initdb.d command: mysqld --lower_case_table_names=1 --default-authentication-plugin=mysql_native_password network_mode: "host"