group-buying/docs/dev-ops/docker-compose-environment.yml

87 lines
2.0 KiB
YAML

version: '3.8'
services:
mysql:
image: mysql:8.0
container_name: group-buy-mysql
hostname: mysql
command: --default-authentication-plugin=mysql_native_password
restart: unless-stopped
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: 123456
ports:
- "13306:3306"
volumes:
- ./mysql/my.cnf:/etc/mysql/conf.d/mysql.cnf:ro
- ./mysql/sql:/docker-entrypoint-initdb.d
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
interval: 5s
timeout: 10s
retries: 10
start_period: 15s
networks:
- group-buy-network
# Redis
redis:
image: redis:6.2
restart: unless-stopped
container_name: group-buy-redis
hostname: redis
privileged: true
ports:
- 16379:6379
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
networks:
- group-buy-network
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 3
# rabbitmq
# 账密 admin/admin
# rabbitmq-plugins enable rabbitmq_management
rabbitmq:
image: rabbitmq:3.8-management
container_name: group-buy-rabbitmq
hostname: rabbitmq
restart: unless-stopped
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: admin
RABBITMQ_DEFAULT_PASS: admin
command: rabbitmq-server
volumes:
- ./rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins
- ./rabbitmq/mq-data:/var/lib/rabbitmq
networks:
- group-buy-network
nacos:
image: nacos/nacos-server:v2.1.0
container_name: group-buy-nacos-server
hostname: nacos-server
restart: unless-stopped
env_file:
- ./nacos/custom.env
ports:
- "8848:8848"
- "9848:9848"
- "9849:9849"
depends_on:
- mysql
networks:
- group-buy-network
volumes:
- ./nacos/init.d:/docker-entrypoint-init.d
networks:
group-buy-network:
driver: bridge