🍔 A Node.js Serverless Framework for front-end/full-stack developers. Build the application for next decade. Works on AWS, Alibaba Cloud, Tencent Cloud and traditional VM/Container. Super easy integrate with React and Vue. 🌈
docker pull library/redis
docker run -d -p 6379:6379 --name midway redis:7.4.10
docker compose up -d
services:
redis:
image: redis:7.4.10
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "6379:6379"
rabbitmq:
image: rabbitmq:3-management
healthcheck:
test: ["CMD", "rabbitmqctl", "node_health_check"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "5672:5672"
- "15672:15672"
zookeeper:
image: wurstmeister/zookeeper
environment:
ALLOW_ANONYMOUS_LOGIN: "yes"
healthcheck:
test: ["CMD", "sh", "-c", "echo mntr | nc -w 2 -q 2 localhost 2181"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka
environment:
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 # 保留你原本配置
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_PORT: 9092
healthcheck:
test: ["CMD", "sh", "-c", "kafka-broker-api-versions.sh --version"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "9092:9092"
depends_on:
- zookeeper
etcd:
image: gcr.io/etcd-development/etcd:v3.7.1
command:
- /usr/local/bin/etcd
- --name
- s1
- --data-dir
- /etcd-data
- --listen-client-urls
- http://0.0.0.0:2379
- --advertise-client-urls
- http://0.0.0.0:2379
- --listen-peer-urls
- http://0.0.0.0:2380
- --initial-advertise-peer-urls
- http://0.0.0.0:2380
- --initial-cluster
- s1=http://0.0.0.0:2380
- --initial-cluster-token
- tkn
- --initial-cluster-state
- new
ports:
- "2379:2379"
- "2380:2380"
mongodb:
image: mongo:4.4
ports:
- "27017:27017"
mosquitto:
image: eclipse-mosquitto:latest
ports:
- "1883:1883"
- "8883:8883"
volumes:
- ./packages/mqtt/scripts/mosquitto.conf:/mosquitto/config/mosquitto.conf
consul:
image: hashicorp/consul:1.22.7
command: agent -dev -client=0.0.0.0
ports:
- "8500:8500"
- "8600:8600/udp"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8500/v1/status/leader"]
interval: 10s
timeout: 5s
retries: 5